This way your app will be executed straight from your source directory. ![]() $ python setup.py develop -always-unzip -allow-hosts=None -find-links=/pypi ![]() If you want to be able to run your app with all the necessary dependencies while still hacking on it, you'll do something like this: ~/src/myapp/setup.py will have install_requires list that mentions one or more things that you have in your /pypi directory. Suppose you have a properly formed Python application in ~/src/myapp. Some packages aren't on PYPI, so same applies to them. I do it a lot when I want a more recent (less stable) version of something. Some packages may have to be archived into similar looking tarballs by hand. If the package is on PYPI, download it and its dependencies to some local directory. Then upload to your target machine:ġ) Execute tar -zxf to extract the filesĢ) Execute pip install -r wheelhouse/requirements.txt -no-index -find-links wheelhouse to install the libs and their dependencies Then you can go in to requirements.txt and remove un-needed ones.Ģ) Execute command mkdir wheelhouse & pip download -r requirements.txt -d wheelhouse to download libs and their dependencies to directory wheelhouseģ) Copy requirements.txt into wheelhouse directoryĤ) Archive wheelhouse into with tar -zcf wheelhouse This will list all libraries in your environment. One option for creating the requirements file is to use pip freeze > requirements.txt. If you want install python libs and their dependencies offline, finish following these steps on a machine with the same os, network connected, and python installed:ġ) Create a requirements.txt file with similar content (Note - these are the libraries you wish to download): Flask=0.12
0 Comments
Leave a Reply. |