Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"pip install line_profiler" fails

Tags:

python

pip

I type

sudo pip install "line_profiler"

and I get

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

When I search for line_profile using

sudo pip search "line_profiler"

I get:

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.

Somehow the underscore gets turned to "-". How can I bypass that?

like image 888
milia Avatar asked Jun 14 '14 00:06

milia


1 Answers

The problem is not in the fact that pip converts _ into the - to meet the package naming requirements, but the thing is: the package is in beta state, there is no stable package versions. In other words, there are only beta package version links available on the package PyPI page. As you see, pip sees it:

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

According to the Pre-release Versions documentation page:

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.

Pass --pre argument to the pip install:

--pre

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

sudo pip install --pre line_profiler

Or, install a specific version:

sudo pip install line_profiler==1.0b3
like image 89
alecxe Avatar answered Sep 23 '22 11:09

alecxe