user1157751 user1157751 - 10 months ago 42
Python Question

python install - already installed a package, why is it searching pypi to install it?

I'm trying to install linecache2, which has a pre-requisite of pbr.

I went to pypi, and installed pbr by downloading and running build since I'm behind a firewall:

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

Then I went to linecache, and tried to install it using the same method:

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

However, it outputs:

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

Since I already have pbr, why is it trying to go look for pbr?

Any help is greatly appreciated! Thanks!

Answer Source

You have just built pbr, you should install it:

python install