Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't pip find pysvn?

I'm working on a project which was written in Python 2, and I'm upgrading it to Python 3. So far, I've just been finding minor syntax errors which are easily fixable. What I've done is created a new project in Python 3, ensured that it worked, and copies chunks of code from the old project into the new one.

Right now, I'm having trouble with pysvn. Initially, I was getting this error:

ImportError: No module named 'pysvn'

At this point, I tried using pip install pysvn, which didn't work. I got the following:

pip install pysvn

Collecting pysvn

Could not find a version that satisfies the requirement pysvn (from versions:)

No matching distribution found for pysvn

So then after a bit of research, I went to the pysvn download site and tried:

>pip install --index-url http://pysvn.tigris.org/project_downloads.html pysvn, which gave me this error:

Collecting pysvn

The repository located at pysvn.tigris.org is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host pysvn.tigris.org'.

and also the same error as when I tried >pip install pysvn.

My next step was to manually download the .exe file for the version I needed, and I was able to successfully install pysvn. I have checked the site-packages directory, and pysvn is indeed there, but pip still can't tell me anything about it:

>pip show pysvn

>

When I do this for another installed module, selenium for example, I get the following:

pip show selenium


Metadata-Version: 1.1

Name: selenium

Version: 2.49.2

Summary: Python bindings for Selenium

Home-page: https://github.com/SeleniumHQ/selenium/

Author: UNKNOWN

Author-email: UNKNOWN

License: UNKNOWN

Location: ...\lib\site-packages

Requires:

I was able to verify that the installation of pysvn was successful because my project now runs instead of giving me that ImportError.

So why can pip not give me information for another module in the same directory that was successfully installed?

like image 916
DJGrandpaJ Avatar asked Feb 24 '16 18:02

DJGrandpaJ


1 Answers

As it turns out, because I didn't use pip install for pysvn, pip didn't know that pysvn existed. Because it wasn't available from PyPI (the Python Package Index), there was no way that pip could see it (because that's where pip goes first to find packages that it's attempting to install).

From the pip user guide:

pip supports installing from PyPI, version control, local projects, and directly from distribution files.

Since I had eventually downloaded pysvn from its own download site (which was not any of the above 4 options) and ran the .exe manually, pip simply doesn't know about it even though it's in the same directory as other packages installed by pip.

I suppose I could've also retrieved the distribution files and used pip with those, but my workaround did the trick.

like image 112
DJGrandpaJ Avatar answered Sep 25 '22 16:09

DJGrandpaJ