I've created an environment and added a package django-paramfield via git:
$ pip install git+https://bitbucket.org/DataGreed/django-paramfield.git
Downloading/unpacking git+https://bitbucket.org/DataGreed/django-paramfield.git
Cloning https://bitbucket.org/DataGreed/django-paramfield.git to /var/folders/9Z/9ZQZ1Q3WGMOW+JguzcBKNU+++TI/-Tmp-/pip-49Eokm-build
Unpacking objects: 100% (29/29), done.
Running setup.py egg_info for package from git+https://bitbucket.org/DataGreed/django-paramfield.git
Installing collected packages: paramfield
Running setup.py install for paramfield
Successfully installed paramfield
Cleaning up...
But when i want to create a requirements file, i see only the package name:
$ pip freeze
paramfield==0.1
wsgiref==0.1.2
How can I make it output the whole string git+https://bitbucket.org/DataGreed/django-paramfield.git
instead of just a package name? The package isn't in PyPi.
UPD: perhaps, it has to do something with setup.py? Should I change it somehow to reflect repo url?
UPD2: I found quite a similar question in stackoverflow, but the author was not sure how did he manage to resolve an issue and the accepted answer doesn't give a good hint unfortunately, though judging from the author's commentary it has something to do with the setup.py file.
UPD3: I've tried to pass download_url
in setup.py and installing package via pip with this url, but he problem persists.
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.
Therefore, you should use pip list and pip freeze as follows: If you want to check a list of packages with various conditions, use pip list . If you want to create requirements. txt , use pip freeze .
pip freeze is a very useful command, because it tells you which modules you've installed with pip install and the versions of these modules that you are currently have installed on your computer. In Python, there's a lot of things that may be incompatible, such as certain modules being incompatible with other modules.
A simple but working workaround would be to install the package with the -e
flag like pip install -e git+https://bitbucket.org/DataGreed/django-paramfield.git#egg=django-paramfield
.
Then pip freeze
shows the full source path of the package. It's not the best way it should be fixed in pip but it's working. The trade off -e
(editing flag) is that pip clones the git/hg repo into /path/to/venv/src/packagename
and run python setup.py deploy
instead of clone it into a temp dir and run python setup.py install
and remove the temp dir after the setup of the package.
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