鱼C论坛

 找回密码
 立即注册
查看: 1764|回复: 5

[已解决]使用openpyxl、安装pipenv错误

[复制链接]
发表于 2021-8-15 19:03:11 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. Requirement already satisfied: openpyxl in c:\programdata\anaconda3\lib\site-packages (2.6.1)
  2. Requirement already satisfied: et-xmlfile in c:\programdata\anaconda3\lib\site-packages (from openpyxl) (1.0.1)
  3. Requirement already satisfied: jdcal in c:\programdata\anaconda3\lib\site-packages (from openpyxl) (1.4)
复制代码
  1. >>> import openpyxl
  2. Traceback (most recent call last):
  3.   File "<pyshell#0>", line 1, in <module>
  4.     import openpyxl
  5. ModuleNotFoundError: No module named 'openpyxl'
复制代码
  1. Collecting pipenv
  2.   Using cached https://files.pythonhosted.org/packages/c1/a3/d266421362565864f130cb97f55f70c763b843c9a67311d215d75b7ec46
  3. 4/pipenv-2021.5.29-py2.py3-none-any.whl
  4. Requirement already satisfied: pip>=18.0 in c:\programdata\anaconda3\lib\site-packages (from pipenv) (19.0.3)
  5. Requirement already satisfied: virtualenv-clone>=0.2.5 in c:\programdata\anaconda3\lib\site-packages (from pipenv) (0.5.
  6. 6)
  7. Collecting virtualenv (from pipenv)
  8.   Using cached https://files.pythonhosted.org/packages/ab/9f/a0d49dcde93f27125f011f8ce60f86840bc69c95695ed8ed2d77adb2cb8
  9. c/virtualenv-20.7.2-py2.py3-none-any.whl
  10. Requirement already satisfied: certifi in c:\programdata\anaconda3\lib\site-packages (from pipenv) (2019.3.9)
  11. Requirement already satisfied: setuptools>=36.2.1 in c:\programdata\anaconda3\lib\site-packages (from pipenv) (40.8.0)
  12. Collecting importlib-metadata>=0.12; python_version < "3.8" (from virtualenv->pipenv)
  13.   Using cached https://files.pythonhosted.org/packages/c0/72/4512a88e402d4dc3bab49a845130d95ac48936ef3a9469b55cc79a60d84
  14. d/importlib_metadata-4.6.4-py3-none-any.whl
  15. Requirement already satisfied: distlib<1,>=0.3.1 in c:\programdata\anaconda3\lib\site-packages (from virtualenv->pipenv)
  16. (0.3.2)
  17. Requirement already satisfied: six<2,>=1.9.0 in c:\programdata\anaconda3\lib\site-packages (from virtualenv->pipenv) (1.
  18. 12.0)
  19. Requirement already satisfied: filelock<4,>=3.0.0 in c:\programdata\anaconda3\lib\site-packages (from virtualenv->pipenv
  20. ) (3.0.10)
  21. Requirement already satisfied: platformdirs<3,>=2 in c:\programdata\anaconda3\lib\site-packages (from virtualenv->pipenv
  22. ) (2.2.0)
  23. Collecting backports.entry-points-selectable>=1.0.4 (from virtualenv->pipenv)
  24.   Using cached https://files.pythonhosted.org/packages/0c/cd/1e156227cad9f599524eb10af62a2362f872910a49402dbd2bea2dedc91
  25. c/backports.entry_points_selectable-1.1.0-py2.py3-none-any.whl
  26. Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in c:\programdata\anaconda3\lib\site-pac
  27. kages (from importlib-metadata>=0.12; python_version < "3.8"->virtualenv->pipenv) (3.10.0.0)
  28. Collecting zipp>=0.5 (from importlib-metadata>=0.12; python_version < "3.8"->virtualenv->pipenv)
  29.   Using cached https://files.pythonhosted.org/packages/92/d9/89f433969fb8dc5b9cbdd4b4deb587720ec1aeb59a020cf15002b9593ee
  30. f/zipp-3.5.0-py3-none-any.whl
  31. Installing collected packages: zipp, importlib-metadata, backports.entry-points-selectable, virtualenv, pipenv
  32.   Found existing installation: zipp 0.3.3
  33.     Uninstalling zipp-0.3.3:
  34. Could not install packages due to an EnvironmentError: [WinError 5] ?????: 'c:\\programdata\\anaconda3\\lib\\site-packag
  35. es\\__pycache__\\zipp.cpython-37.pyc'
  36. Consider using the `--user` option or check the permissions.
复制代码

我在分别安装openpyxl 与 pipenv时分别遇到了如上错误
请问如何解决
最佳答案
2021-8-16 06:52:35


出现 Requirement 一般是符合 Python 安装条件,只需要在 pip 安装时候带上 Python 路径即可,具体操作步骤如下:

一、找自己的python安装路径然后打开\Lib\site-packages复制完整路径,然后复制到这个代码中去cmd 安装

pip install --target=完整路径 库名


比如 我的路径为 X:\Python 3.7.7\Lib\site-packages 就这样安装:

  1. pip install --target=X:\Python 3.7.7\Lib\site-packages openpyxl
复制代码



小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-8-15 19:07:31 | 显示全部楼层
我估计使用不了openpyxl可能是因为python没有那里的搜索模块路径,不过我不知道怎么添加来着?
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-8-15 21:01:12 | 显示全部楼层
你在高级系统设置里添加一下环境变量。右键你python所在的文件夹的Scripts,把这个路径添加到环境变量里试试看
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-8-16 06:52:35 | 显示全部楼层    本楼为最佳答案   


出现 Requirement 一般是符合 Python 安装条件,只需要在 pip 安装时候带上 Python 路径即可,具体操作步骤如下:

一、找自己的python安装路径然后打开\Lib\site-packages复制完整路径,然后复制到这个代码中去cmd 安装

pip install --target=完整路径 库名


比如 我的路径为 X:\Python 3.7.7\Lib\site-packages 就这样安装:

  1. pip install --target=X:\Python 3.7.7\Lib\site-packages openpyxl
复制代码



小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-8-16 11:22:09 | 显示全部楼层
本帖最后由 磊之茶 于 2021-8-16 11:28 编辑

不小心多发了,忽略
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-8-16 11:27:46 | 显示全部楼层
本帖最后由 磊之茶 于 2021-8-16 16:03 编辑

算了,分两个帖子问吧
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-20 03:12

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表