没有名为' pip'的模块安装OpenPyXl时在Windows上
我是第一次安装第三方模块。
我在Python 3.10上。我已经下载了openpyxl
,然后将zip文件夹提取到:
D:\Users\XXXX\AppData\Local\Programs\Python\Python310\Lib
然后我转到:
D:\Users\XXXX\AppData\Local\Programs\Python\Python310\Scripts
地址栏上的键入cmd
,然后键入pip pip install openpyxl
。
这是返回的消息:
D:\Users\XXXX\AppData\Local\Programs\Python\Python310\Scripts>pip install openpyxl
Traceback (most recent call last):
File "D:\Users\XXXX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\Users\XXXX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\Users\XXXX\AppData\Local\Programs\Python\Python310\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
I am install a third party module for the first time.
I am on python 3.10. I have download the openpyxl
and extracted the zip folder into:
D:\Users\XXXX\AppData\Local\Programs\Python\Python310\Lib
Then I went to:
D:\Users\XXXX\AppData\Local\Programs\Python\Python310\Scripts
Typed cmd
on the address bar and then typed pip install openpyxl
.
This is the message returned:
D:\Users\XXXX\AppData\Local\Programs\Python\Python310\Scripts>pip install openpyxl
Traceback (most recent call last):
File "D:\Users\XXXX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\Users\XXXX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\Users\XXXX\AppData\Local\Programs\Python\Python310\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那是因为
pip
是一个别名。 True命令确实是pip3
(或取决于您使用的Python版本)。对于Ubuntu,有一个有用的工具,称为Python3-is-Python,可以创建此别名。尝试查看Windows是否也存在!另外,请确保您正在以管理员的身份运行
cmd
。 Windows无法看到这些命令非常常见。That's because
pip
is an Alias. The true command is indeedpip3
(orpip2
depending on what Python version you're using). For Ubuntu, there is an useful tool called python3-is-python which creates this alias. Try looking if this also exists for Windows!Also, make sure you are running the
cmd
as administrator. It is very common for Windows to not be able to see those commands.