I would like to use for a small Python project this way of managing dependent modules: http://blog.zoomeranalytics.com/pip-install-t/
In brief, I would do:
cd myproject
pip install --target ./pip-libs --upgrade -r requirements.txt
then add ./pip-libs to PYTHONPATH and run my script.
This seems but I like to use use pip freeze and it does not allow me to do anything like
pip freeze --target pip-libs
to see packages installed in the folder. Of course, I can take a look inside but what is a standard way to show packages installed in a folder with --target? The only way I can think of is doing ls
of pip-libs and then playing with grep, awk... Does not seem right.
I am not sure if there is a way, maybe it's not a good idea or I should request such functionality for pip.
Python 2.7.9.
The most common command is pip freeze > requirements. txt , which records an environment's current package list into requirements. txt. If you want to install the dependencies in a virtual environment, create and activate that environment first, then use the Install from requirements.
pip freeze might seem very useful initially but it can mess up your project because of the following reasons: It dumps all the libraries installed in your project including dependencies and sub-dependencies in the requirements. txt file. It still misses out on the libraries that are not installed using pip.
To do so, we can use the pip list -o or pip list --outdated command, which returns a list of packages with the version currently installed and the latest available. On the other hand, to list out all the packages that are up to date, we can use the pip list -u or pip list --uptodate command.
Bit late to the party, but I ran in to the same issue and this seemed to solve it.
pip freeze --path ./pip-libs > requirements.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With