我发现,最近当我尝试使用pip安装Python包时,经常会得到以下错误。
我在网上找到了一个参考,一个人必须从下载目录中使用“python2 setup.py install”,并且确实发现如果我手动找到并下载包(从pypi),这将会工作。
但是,我不知道pip将包下载到哪里,和/或为什么它会以这种方式失败。
我尝试进行pip升级,但它也以类似的方式失败,出现了一堆“未知分发选项”错误(entry_points, zip_safe, test_suite, tests_require)!
皮普1.0.1 ActivePython 2.7
尝试使用ActiveState的pypm会失败,因为它们的库基数较小,而且不包括这些包。
C:\test>pip install requests-oauth
Downloading/unpacking requests-oauth
Downloading requests-oauth-0.4.1.tar.gz
Running setup.py egg_info for package requests-oauth
E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
Complete output from command python setup.py egg_info:
E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'