requirements.txt

requirements.txt vs setup.py

回眸只為那壹抹淺笑 提交于 2019-11-28 16:37:42
I started working with Python. I've added requirements.txt and setup.py to my project. But, I am still confused about the purpose of both files. I have read that setup.py is designed for redistributable things and that requirements.txt is designed for non-redistributable things. But I am not certain this is accurate. How are those two files truly intended to be used? requirements.txt This helps you to set up your development environment. Programs like pip can be used to install all packages listed in the file in one fell swoop. After that you can start developing your python script. Especially

Check if my Python has all required packages

眉间皱痕 提交于 2019-11-28 16:31:19
问题 I have a requirements.txt file with a list of packages that are required for my virtual environment. Is it possible to find out whether all the packages mentioned in the file are present. If some packages are missing, how to find out which are the missing packages? 回答1: UPDATE : An up-to-date and improved way to do this is via distutils.text_file.TextFile . See Acumenus' answer below for details. ORIGINAL : The pythonic way of doing it is via the pkg_resources API. The requirements are

Pip Requirements.txt --global-option causing installation errors with other packages. “option not recognized”

二次信任 提交于 2019-11-28 07:20:54
问题 I'm having difficulties with the --global-option and --install-option settings for a requirements.txt file. Specifying the options for one library is causing other libraries installs to fail. I'm trying to install Python libraries "grab" and "pycurl". I need to specify that pycurl be installed with option: "--with-nss". I can replicate the error on a completely clean virtual enviroment. On a new virtual environment With requirements.txt containing: grab==0.6.25 pycurl==7.43.0 --install-option

In requirements.txt, what does tilde equals (~=) mean?

坚强是说给别人听的谎言 提交于 2019-11-28 06:44:33
In the requirements.txt for a Python library I am using, one of the requirements is specified like: mock-django~=0.6.10 What does ~= mean? Maxime Lorant It means it will select the latest version of the package, greater or equal to 0.6.10, but still in the 0.6.* version, so it won't download 0.7.0 for example. It ensures you will get security fixes but keep backward-compatibility, if the package maintainer respects the semantic versioning (which states that breaking changes should occur only in major versions). Or, as said by PEP 440: For a given release identifier V.N , the compatible release

Could not find a version that satisfies the requirement <package>

心不动则不痛 提交于 2019-11-27 17:28:38
I'm installing several Python packages in Ubuntu 12.04 using the following requirements.txt file: numpy>=1.8.2,<2.0.0 matplotlib>=1.3.1,<2.0.0 scipy>=0.14.0,<1.0.0 astroML>=0.2,<1.0 scikit-learn>=0.14.1,<1.0.0 rpy2>=2.4.3,<3.0.0 and these two commands: $ pip install --download=/tmp -r requirements.txt $ pip install --user --no-index --find-links=/tmp -r requirements.txt (the first one downloads the packages and the second one installs them). The process is frequently stopped with the error: Could not find a version that satisfies the requirement <package> (from matplotlib<2.0.0,>=1.3.1->-r

How to specify install order for python pip?

有些话、适合烂在心里 提交于 2019-11-27 12:33:25
I'm working with fabric(0.9.4)+pip(0.8.2) and I need to install some python modules for multiple servers. All servers have old version of setuptools (0.6c8) which needs to be upgraded for pymongo module. Pymongo requires setuptools>=0.6c9. My problem is that pip starts installation with pymongo instead of setuptools which causes pip to stop. Shuffling module order in requirements file doesn't seem to help. requirements.txt: setuptools>=0.6c9 pymongo==1.9 simplejson==2.1.3 Is there a way to specify install order for pip as it doesn't seem to do it properly by itself? This can be resolved with

Delete unused packages from requirements file

馋奶兔 提交于 2019-11-27 11:30:42
问题 Is there any easy way to delete no-more-using packages from requirements file? I wrote a bash script for this task but, it doesn't work as I expected. Because, some packages are not used following their PyPI project names. For example; dj-database-url package is used as dj_database_url My project has many packages in its own requirements file, so, searching them one-by-one is too messy, error-prone and takes too much time. As I searched, IDEs don't have this property, yet. 回答1: You can use

tell pip to install the dependencies of packages listed in a requirement file

╄→гoц情女王★ 提交于 2019-11-27 09:57:38
问题 Developing a Django web app, I have a list of packages I need to install in a virtualenv. Say: Django==1.3.1 --extra-index-url=http://dist.pinaxproject.com/dev/ Pinax==0.9b1.dev10 git+git://github.com/pinax/pinax-theme-bootstrap.git@cff4f5bbe9f87f0c67ee9ada9aa8ae82978f9890 # and other packages Initially I installed them manually, one by one, along the development. This installed the required dependencies and I finally used pip freeze before deploying the app. Problem is, as I upgraded some

requirements.txt vs setup.py

…衆ロ難τιáo~ 提交于 2019-11-27 09:28:18
问题 I started working with Python. I've added requirements.txt and setup.py to my project. But, I am still confused about the purpose of both files. I have read that setup.py is designed for redistributable things and that requirements.txt is designed for non-redistributable things. But I am not certain this is accurate. How are those two files truly intended to be used? 回答1: requirements.txt This helps you to set up your development environment. Programs like pip can be used to install all

How to customize a requirements.txt for multiple environments?

纵饮孤独 提交于 2019-11-27 06:03:36
I have two branches, Development and Production. Each has dependencies, some of which are different. Development points to dependencies that are themselves in development. Likewise for Production. I need to deploy to Heroku which expects each branch's dependencies in a single file called 'requirements.txt'. What is the best way to organize? What I've thought of: Maintain separate requirements files, one in each branch (must survive frequent merges!) Tell Heroku which requirements file I want to use (environment variable?) Write deploy scripts (create temp branch, modify requirements file,