![安装 opts 模块时,“pip install”在 Windows 版 Python 上损坏](https://linux22.com/image/1600783/%E5%AE%89%E8%A3%85%20opts%20%E6%A8%A1%E5%9D%97%E6%97%B6%EF%BC%8C%E2%80%9Cpip%20install%E2%80%9D%E5%9C%A8%20Windows%20%E7%89%88%20Python%20%E4%B8%8A%E6%8D%9F%E5%9D%8F.png)
我尝试安装时出现错误链选择在文件夹中的Python 自己的pip
脚本上Python34
。不知为何它无法安装。
尝试选择:
----------------------------------->>>
Downloading/unpacking opts
Downloading opts-0.1.1.tar.gz
Running setup.py (path:C:\Users\user\AppData\Local\Temp\pip_build_user\opts\setup.py) egg_info for package opts
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\Users\user\AppData\Local\Temp\pip_build_user\opts\setup.py", line 3, in <module>
from distribute_setup import use_setuptools
ImportError: No module named 'distribute_setup'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\Users\user\AppData\Local\Temp\pip_build_user\opts\setup.py", line 3, in <module>
from distribute_setup import use_setuptools
ImportError: No module named 'distribute_setup'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip_build_user\opts
Storing debug log for failure in C:\Users\user\pip\pip.log
我尝试安装distribute_setup
:
---------->
C:\Python34\Scripts>pip install distribute_setup
Downloading/unpacking distribute-setup
Could not find any downloads that satisfy the requirement distribute-setup
Cleaning up...
No distributions at all found for distribute-setup
Storing debug log for failure in C:\Users\user\pip\pip.log
pip.log 文件:
---------->
C:\Python34\Scripts\pip run on 08/17/19 02:17:45
Downloading/unpacking distribute-setup
Getting page https://pypi.python.org/simple/distribute_setup/
Could not fetch URL https://pypi.python.org/simple/distribute_setup/: 404 Client Error: Not Found
Will skip URL https://pypi.python.org/simple/distribute_setup/ when looking for download links for distribute-setup
Getting page https://pypi.python.org/simple/
URLs to search for versions for distribute-setup:
* https://pypi.python.org/simple/distribute_setup/
Getting page https://pypi.python.org/simple/distribute_setup/
Could not fetch URL https://pypi.python.org/simple/distribute_setup/: 404 Client Error: Not Found
Will skip URL https://pypi.python.org/simple/distribute_setup/ when looking for download links for distribute-setup
Could not find any downloads that satisfy the requirement distribute-setup
Cleaning up...
Removing temporary dir C:\Users\user\AppData\Local\Temp\pip_build_user...
No distributions at all found for distribute-setup
Exception information:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python34\lib\site-packages\pip\req.py", line 1177, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "C:\Python34\lib\site-packages\pip\index.py", line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
pip.exceptions.DistributionNotFound: No distributions at all found for distribute-setup
答案1
pip install
不知为何被打破了[.]
这似乎不太可能。
pip
我在 Python 2.7.16 和 Python 3.x 中使用相对较新的版本(分别为pip
版本 18.x 和版本 19.x)时都遇到了相同的错误pip
。pip
除此之外,对我来说一切正常。
更有可能的是,这opts
是一个旧模块,并且在其脚本中使用了过时的参考和说明,从而导致了错误。
关于年龄,请考虑opts 于 2010 年发布,以及 Python 2.7目前Python 2.7 的官方支持将于 2020 年 1 月结束。
建议,如果这不仅仅是现有脚本的支持模块,你应该考虑使用除 之外的其他东西opts
。一种选择可能是 Python 自己的参数解析图书馆。