简体   繁体   English

可以使用pip搜索PyPI软件包,但无法安装。 easy_install工作正常

[英]PyPI package can be searched using pip but cannot be installed. easy_install works fine

I'm running into an issue where I execute pip install python-sdk-auth , and I get this error: 我遇到了执行pip install python-sdk-auth ,并且出现此错误:

Could not find a version that satisfies the requirement python-sdk-auth (from versions: ) No matching distribution found for python-sdk-auth

This package was initially built by running: 该软件包最初是通过运行以下命令构建的:

python setup.py bdist_egg --exclude-source-files

to only contain .pyc files and uploaded via this twine : 只包含.pyc文件并通过此twine上传:

twine upload dist/<packagename>.egg

Here are more observations: 这里有更多观察结果:

  1. I'm able to pip search python-sdk-auth and the package seems to be present in the package directory. 我能够pip search python-sdk-auth并且该软件包似乎存在于package目录中。
  2. I'm able to do easy_install python-sdk-auth , and the package will be installed successfully. 我可以执行easy_install python-sdk-auth ,该软件包将成功安装。
  3. I'm running python v2.7. 我正在运行python v2.7。

It seems like I could do this via easy_install , but not on pip . 看来我可以通过easy_install来做到这一点,但不能在pip上做到。 My main intention is to have this package be a dependency of another package (as specified via the install_requires parameter in setup.py , but it seems like even installing this via pip install in a virtualenv environment throws an error above. Any suggestions on what went wrong here? Thanks! 我的主要目的是使该程序包成为另一个程序包的依赖项(通过setup.pyinstall_requires参数指定,但似乎甚至通过在virtualenv环境中通过pip install也会在上面抛出错误。错在这里吗?

The only distribution for the package available on PyPI is an egg, an older format that is used by setuptools (and thus easy_install ) but not pip. PyPI上可用的软件包的唯一发行版是egg,这是setuptools(因此easy_install )使用的较早格式,而不是pip。 Pip can only install packages from source distributions made with sdist (which every package should have) and from wheels (the replacement for the egg format, which should be preferred to eggs 99.9999% of the time). Pip只能从使用sdist (每个软件包应具有)的源分发版和从轮子(从egg格式的替代版本中安装软件包)进行安装,99.9999%的时间应优先于egg格式。 Build & upload one (or, better, both) of these files to PyPI to make your package installable via pip. 将其中一个文件(或更好的是两个文件)构建并上传到PyPI,以使您的软件包可通过pip安装。

Recommended further reading: https://packaging.python.org/distributing/ 建议进一步阅读: https : //packaging.python.org/distributing/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM