New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation of python requirements with pip -r
#1950
Conversation
I'm pretty sure that your recommend change won't work for a fresh environment with nothing installed (but correct me if I'm wrong). Installing everything from scratch with a single |
On the page I linked to:
Which makes me believe that the change works the same way as doing the for-loop expansion, by running a bunch of pip install commands in the order specified in the requirements file. To test, I made a virtualenv and ran the pip install -r command on requirements.txt with these commands from the caffe base directory:
and it seemed to install everything fine (on my OSX setup): first cython is installed, then numpy, then scipy, etc. You might want to try this on your computer, though. I'm not sure if you'll get the same result. |
I included the for loop expansion because I'm fairly certain running |
See http://stackoverflow.com/questions/5394356/how-to-specify-install-order-for-python-pip, etc. Unless this has been changed, it seems that order is not respected in general, although maybe it shouldn't matter if all dependencies are correctly specified. In any case it's a bit simpler to use |
TLDR: The proposed change does not work on Ubuntu 14.04. I created a fresh Ubuntu 14.04 server EC2 instance to test this out. Installing packages: sudo apt-get update -y sudo apt-get upgrade -y sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev \ libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev \ libgoogle-glog-dev liblmdb-dev protobuf-compiler sudo apt-get install -y python-dev sudo apt-get install -y python-pip sudo apt-get install -y gfortran sudo apt-get install -y libatlas-base-dev sudo apt-get install -y git Installing python requirements: git clone https://github.com/BVLC/caffe cd caffe/python sudo pip install -r requirements.txt This fails at installing ... Downloading/unpacking scikit-image>=0.9.3 (from -r requirements.txt (line 4)) Downloading scikit-image-0.10.1.tar.gz (16.7MB): 16.7MB downloaded Running setup.py (path:/tmp/pip_build_root/scikit-image/setup.py) egg_info for package scikit-image Traceback (most recent call last): File "", line 17, in File "/tmp/pip_build_root/scikit-image/setup.py", line 37, in from numpy.distutils.core import setup ImportError: No module named numpy.distutils.core Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 17, in File "/tmp/pip_build_root/scikit-image/setup.py", line 37, in from numpy.distutils.core import setup ImportError: No module named numpy.distutils.core ---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/scikit-image Traceback (most recent call last): File "/usr/bin/pip", line 9, in load_entry_point('pip==1.5.4', 'console_scripts', 'pip')() File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main return command.main(cmd_args) File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 72: ordinal not in range(128) ubuntu@ip-10-139-88-123:~/caffe/python$ But this works: for req in $(cat requirements.txt); do sudo pip install $req; done It seems that I also tried using a virtualenv: even after globally installing the packages (one at a time), and then creating a Side note: It seems that |
Ah, fair enough. I guess it's working on my machine because of something to do with OSX:
And at the end...
Here's the full setup log for posterity: http://pastebin.com/NAQPXeAw, but I'm satisfied with closing this. |
The problem occurs because pip installs things in the opposite of the order specified. If you re-order your This installation works for @pgao on OS X because a wheel is available for |
-r
Re-ordering so h5py is before cython would make the most sense here.. |
BTW, with any recent pip version (>= 6.1.0), all dependencies should now install in the correct order regardless. |
Minor change, but this is the recommended way of installing requirements files.
https://pip.pypa.io/en/latest/user_guide.html#requirements-files