【问题标题】:cant python3 pip package I just uploaded? ("Could not find a version that satisfies..")我刚刚上传的python3 pip包不能吗? (“找不到满足的版本..”)
【发布时间】:2020-01-23 09:53:35
【问题描述】:

我做了一个pip包上传到这里:

https://pypi.org/project/audacityDiscogsExporter/0.1.0/

如果我运行pip install audacityDiscogsExporter==0.1.0pip install audacityDiscogsExporter,我会收到一条错误消息:

martin@MSI:/mnt/c/Users/marti/Documents/projects/package$ pip install audacityDiscogsExporter
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement audacityDiscogsExporter (from versions: none)
ERROR: No matching distribution found for audacityDiscogsExporter

为什么我不能安装这个包?

【问题讨论】:

  • 使用pip3 安装你的包。
  • pip3 是一个快捷方式,可能有效,也可能与 pip 一样错误。它并没有明显缓解导致问题的不确定性。如果没有进一步的解释,我不会推荐该建议。

标签: python-3.x pip pypi


【解决方案1】:

您似乎正在尝试使用 Python 2 解释器来安装仅限 Python-3 的项目。

当使用pip(或实际上直接使用任何其他 Python 脚本)时,确保使用哪个 Python 解释器很重要。通常调用pip时使用哪个Python解释器是显而易见的,但也经常发生不清楚。最好总是显式调用确切的 Python 解释器。通常:

$ python -m pip install Something
$ # instead of 'pip install Something'
$ python3 -m pip install Something
$ # instead of 'pip3 install Something'

如果仍有疑问,甚至可以更进一步,明确使用 Python 解释器的完整路径:

$ /usr/bin/python3.8 -m pip install Something
$ /path/to/myvenv/bin/python3 -m pip install Something

关于该主题的有趣阅读:Brett Cannon's article "Why you should use python -m pip"

【讨论】:

  • @Martin 这能回答你的问题吗?需要进一步说明吗?
猜你喜欢
  • 2021-12-25
  • 2019-09-14
  • 1970-01-01
  • 2016-12-18
  • 1970-01-01
  • 2023-03-12
  • 2020-10-21
  • 2020-12-04
  • 2021-03-12
相关资源
最近更新 更多