“pip install line_profiler”失败

2024-03-28 08:15:47 发布

您现在位置:Python中文网/ 问答频道 /正文

I型

sudo pip install "line_profiler"

我得到了

Downloading/unpacking line-profiler
  Could not find a version that satisfies the requirement line-profiler (from versions: 1.0b1, 1.0b2, 1.0b3)
Cleaning up...
No distributions matching the version for line-profiler
Storing debug log for failure in /home/milia/.pip/pip.log

当我使用

sudo pip search "line_profiler"

我得到:

django-debug-toolbar-line-profiler - A panel for django-debug-toolbar that integrates
                        information from line_profiler
line_profiler             - Line-by-line profiler.
tracerbullet              - A line-by-line profiler that doesn't suck.

不知怎么的,下划线变成了“-”。我怎么能绕过这个?


Tags: installpipthedjangofromdebuglogfor
2条回答

问题不在于pip_转换为-以满足包命名要求,而是:包处于beta状态,没有稳定的包版本。换句话说,只有package PyPI page上的beta包版本链接可用。如您所见,pip看到它:

Could not find a version that satisfies the requirement line-profiler (from versions: 1.0b1, 1.0b2, 1.0b3)

根据Pre-release Versions文档页面:

Starting with v1.4, pip will only install stable versions as specified by PEP426 by default. If a version cannot be parsed as a compliant PEP426 version then it is assumed to be a pre-release.

^{}参数传递给pip install

--pre

Include pre-release and development versions. By default, pip only finds stable versions.

sudo pip install --pre line_profiler

或者,安装特定版本:

sudo pip install line_profiler==1.0b3

我安装了miniconda并运行这些:

$ conda install -c anaconda line_profiler

相关问题 更多 >