Reputation: 2109
I have a package installed in my /usr/local/lib/python2.7/dist-packages/package-name , its our private repo installed at that place long back and that pip repo not available now , so can I use that particular /usr/local/lib/python2.7/dist-packages/package-name directory to install anywhere else ? This is what I have done:
zipped the directory /usr/local/lib/python2.7/dist-packages/package-name
Upload to my server
Then tried to install using pip like this : pip install myserverpackageurl
Then i got error saying that "setup.py" is not available (IOError) .
I also tried creating a bundle from my directory like this :
cd /usr/local/lib/python2.7/dist-packages/package-name
pip bundle package-name package-name
then again i got the error :
("Directory %r is not installable. File 'setup.py' not found.", 'mm/')
Storing complete log in /home/bhaskar/.pip/pip.log
Upvotes: 2
Views: 7837
Reputation: 1121924
You cannot just zip up a installed package; it doesn't include the setup.py
file needed by tools like pip
to install the a python package and ensure the installation is correct and complete.
Pip only works with source distributions; you usually create such a distribution by running the sdist
command on the existing setup.py
file:
python setup.py sdist
The most recent pip version also supports python eggs, but you'll still need the setup.py
file to create those.
Upvotes: 2