没有名为' pip'的模块安装OpenPyXl时在Windows上

发布于 2025-02-10 17:48:02 字数 995 浏览 0 评论 0原文

我是第一次安装第三方模块。

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫轩蝶泪 2025-02-17 17:48:02

那是因为pip是一个别名。 True命令确实是pip3(或取决于您使用的Python版本)。对于Ubuntu,有一个有用的工具,称为Python3-is-Python,可以创建此别名。尝试查看Windows是否也存在!

另外,请确保您正在以管理员的身份运行cmd。 Windows无法看到这些命令非常常见。

That's because pip is an Alias. The true command is indeed pip3 (or pip2 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文