Why can't pip find pysvn?

I am working on a project that was written in Python 2, and I am updating it to Python 3. So far, I have just discovered minor syntax errors that are easy to fix. I created a new project in Python 3, made it work, and copied code fragments from the old project to the new one.

I am having problems with pysvn now. I originally received this error:

ImportError: no module named 'pysvn'

At this point, I tried using pip install pysvn , which did not work. I got the following:

pip install pysvn

Pysvn collection

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

No suitable distribution found for pysvn

So, after a little research, I went to pysvn to download the site and tried:

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

Pysvn collection

The repository located at pysvn.tigris.org is not a reliable or secure host and is ignored. If this repository is accessible via HTTPS, it is recommended to use HTTPS instead, otherwise you can turn off this warning and in any case enable it using "-trusted-host pysvn.tigris.org".

as well as the same error as trying >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 checked the directory of package sites and pysvn is really there , but pip still can't tell me anything:

 >pip show pysvn > 

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

pip show selenium


Metadata Version: 1.1

Title: selenium

Version: 2.49.2

Summary: Python bindings for Selenium

Homepage: https://github.com/SeleniumHQ/selenium/

Posted by: UNKNOWN

Email author: UNKNOWN

License: UNKNOWN

Location: ... \ lib \ site-packages

It is required:

I was able to verify that the installation of pysvn was successful because my project is now starting up instead of providing ImportError to me.

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

+11
windows pip pysvn
source share
2 answers

As it turned out, because I did not use pip install for pysvn, pip did not know that pysvn exists. Since it was not accessible from PyPI (the Python package index) , there was no way for pip to see it (because where pip goes first to find the packages that it is trying to install).

From the pip manual:

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

Since I ended up downloading pysvn from my own download site (which was not one of the 4 options above) and running. exe manually, pip simply does not know about it , although it is in the same directory as other packages installed using pip .

I suppose I could also get the distribution files and use pip with them, but my workaround did the trick.

+7
source share

My way on Linux:

Get sources from here

 tar -zxf pysvn-1.9.10.tar.gz apt-get install subversion libsvn1 libsvn-dev make g++ cd pysvn-1.9.10/Source python setup.py configure --pycxx-dir=/pysvn-1.9.10/Import/pycxx-7.1.3/ make 

Here I have errors below:

 Compile: /pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxsupport.cxx into cxxsupport.o /pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxsupport.cxx:42:10: fatal error: Src/Python3/cxxsupport.cxx: No such file or directory #include "Src/Python3/cxxsupport.cxx" Compile: /pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxextensions.c into cxxextensions.o /pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxextensions.c:42:10: fatal error: Src/Python3/cxxextensions.c: No such file or directory #include "Src/Python3/cxxextensions.c" 

You need to edit these files: vi /pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxsupport.cxx

 change #include "Src/Python3/cxxsupport.cxx" to #include "Python3/cxxsupport.cxx" 

and the same thing in the second file. Then make again:

 make clean && make ... Compile: /code/pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxextensions.c into cxxextensions.o Compile: /code/pysvn-1.9.10/Import/pycxx-7.1.3/Src/IndirectPythonInterface.cxx into IndirectPythonInterface.o Compile: /code/pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxx_exceptions.cxx into cxx_exceptions.o Link pysvn/_pysvn_3_7.so 

Then just copy it into the site packages (go to your directory):

 mkdir /usr/local/lib/python3.7/site-packages/pysvn cp /code/pysvn-1.9.10/Sources/pysvn/__init__.py /usr/local/lib/python3.7/site-packages/ cp /code/pysvn-1.9.10/Sources/pysvn/_pysvn*.so /usr/local/lib/python3.7/site-packages/ 
0
source share