requirements.txt

Equivalent of `package.json' and `package-lock.json` for `pip`

与世无争的帅哥 提交于 2020-12-25 08:36:14
问题 Package managers for JavaScript like npm and yarn use a package.json to specify 'top-level' dependencies, and create a lock-file to keep track of the specific versions of all packages (i.e. top-level and sub-level dependencies) that are installed as a result. In addition, the package.json allows us to make a distinction between types of top-level dependencies, such as production and development . For Python , on the other hand, we have pip . I suppose the pip equivalent of a lock -file would

pip freeze creates some weird path instead of the package version

为君一笑 提交于 2020-12-19 03:50:32
问题 I am working on developing a python package. I use pip freeze > requirements.txt to add the required package into the requirement.txt file. However, I realized that some of the packages, instead of the package version, have some path in front of them. numpy==1.19.0 packaging==20.4 pandas @ file:///opt/concourse/worker/volumes/live/38d1301c-8fa9-4d2f-662e-34dddf33b183/volume/pandas_1592841668171/work pandocfilters==1.4.2 Whereas, inside the environment, I get: >>> pandas.__version__ '1.0.5' Do

pip freeze creates some weird path instead of the package version

非 Y 不嫁゛ 提交于 2020-12-19 03:49:10
问题 I am working on developing a python package. I use pip freeze > requirements.txt to add the required package into the requirement.txt file. However, I realized that some of the packages, instead of the package version, have some path in front of them. numpy==1.19.0 packaging==20.4 pandas @ file:///opt/concourse/worker/volumes/live/38d1301c-8fa9-4d2f-662e-34dddf33b183/volume/pandas_1592841668171/work pandocfilters==1.4.2 Whereas, inside the environment, I get: >>> pandas.__version__ '1.0.5' Do

Problem installing package using setup.py

你离开我真会死。 提交于 2020-12-13 03:32:07
问题 I have setup.py set to get the dependencies from requirements.txt that I generate from my virtual environment of the project. As follows: In my venv: pip3 freeze > requirements.txt Then: with open('requirements.txt') as f: required = f.read().splitlines() setuptools.setup( ... install_requires=required, ... ) But I have this error displayed when I try to install my package: raise RequirementParseError(str(e)) pip._vendor.pkg_resources.RequirementParseError: Parse error at "'(===file'":

How to install python module extras with pip requirements.txt file

笑着哭i 提交于 2020-08-22 11:37:43
问题 The pip requirements.txt documentation says that extras may be installed using a line like MyPackage==3.0 [PDF] So in my requirements.txt file I have a line that reads: requests==2.9.1 [security] but instead of installing the security extras for the requests module when I run the command: pip install -r requirements.txt I get an error message suggesting that the format of my file is incorrect: Invalid requirement: 'requests==2.9.1 [security]' Traceback (most recent call last): File "/Library

Pip install from a specific commit prompts “requirements already satisfied”

混江龙づ霸主 提交于 2020-08-19 06:42:06
问题 I'm using pip and a requirements.txt file to handle my python packages in my virtualenv. I have a particular package I install from Github so that inside my file I have: git+ssh://git@github.com/myuser/mypackage.git#egg=mypackage Since I'm working on the package quite often I need to re-install it but: pip install -r requirements.txt gives me back Requirement already satisfied (use --upgrade to upgrade)... for all the packages in requirements.txt that have new versions. If I run pip install

pip requirement.txt conditionals or environment markers based on env variables

Deadly 提交于 2020-04-13 06:44:09
问题 Is there a way to specify conditional installs in a pip requirements.txt file that are based on the value of an environment variable? I've been able to control most of what I need with environment markers, but all the markers I know of work only with specific values that are essentially pre-defined by python. For example, I want to be able to control package installation for RHEL 5.3 vs. RHEL 6.3 vs. RHEL 6.6, etc. Also based on other criteria. It would be perfect if I could specify in the