python setup.py install - 已经安装了一个包,为什么还要搜索 pypi 来安装它?

标签 python easy-install python-pbr

我正在尝试安装 linecache2,它的先决条件是 pbr。

我去了 pypi,并通过下载并运行 setup.py build 安装了 pbr,因为我位于防火墙后面:

    cd   C:\Users\<user_name>\Downloads\pbr-1.5.0\pbr-1.5.0
    python setup.py build

然后我进入linecache,并尝试使用相同的方法安装它:

    cd C:\Users\<user_name>\Downloads\linecache2-1.0.0\linecache2-1.0.0
    python setup.py build

但是,它输出:

Download error on https://pypi.python.org/simple/pbr/: timed out -- Some packages may not be found!
Couldn't find index page for 'pbr' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: timed out -- Some packages may not be found!
No local packages or download links found for pbr
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    pbr=True)
  File "C:\Python27\lib\distutils\core.py", line 111, in setup
    _setup_distribution = dist = klass(attrs)
  File "C:\Python27\lib\site-packages\setuptools\dist.py", line 268, in __init__
    self.fetch_build_eggs(attrs['setup_requires'])
  File "C:\Python27\lib\site-packages\setuptools\dist.py", line 313, in fetch_build_eggs
    replace_conflicting=True,
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 830, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1075, in best_match
    return self.obtain(req, installer)
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1087, in obtain
    return installer(requirement)
  File "C:\Python27\lib\site-packages\setuptools\dist.py", line 380, in fetch_build_egg
    return cmd.easy_install(req)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 623, in easy_install
    raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')

既然我已经有了pbr,为什么还要去寻找pbr?

非常感谢任何帮助!谢谢!

最佳答案

您刚刚构建了 pbr,您应该安装它:

python setup.py install

关于python setup.py install - 已经安装了一个包,为什么还要搜索 pypi 来安装它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32106584/

相关文章:

python - 如何在 python 脚本中获取 svn 两个修订版的完整上下文差异?

python - 如何过滤掉嵌套列表中的条件逻辑元素

python - 安装pbr时出错

python - 使用 pbr 时如何将 git repo 包含为依赖项

python - Keras:predict_generator 的输出是什么?

python - TensorFlow: 'ValueError: No gradients provided for any variable'

python - 尝试在 Mac OSX Lion 上安装 pylibmc 时出错

python - 使用 easy_install 安装 pip

python - 在 setup.py 中检测 pip