Could caffe be structured in a way such that the python dependencies reside in a virtualenv?
Is this happening soon?
cd python
virtualenv venv
source venv/bin/activate
for req in $(cat requirements.txt); do pip install $req; done
I don't see anything that needs to change in Caffe.
what's with the for loop? @lukeyeager why not pip install -r requirements.txt
Did you actually try what you recommended? From what I remembered Caffe does not play nicely with virtualenv. Installing this suite was a painful experience.
what's with the for loop?
https://github.com/BVLC/caffe/pull/1950#issuecomment-76026969
Did you actually try what you recommended?
Yep, I do this all the time, and suggest this method for DIGITS users:
https://github.com/NVIDIA/DIGITS/blob/v2.2.1/docs/InstallCaffe.md#python-dependencies
+1 @lukeyeager
@lukeyeager Thanks for the links! But I have another question.
Say I create a virtualenv in some other folder (not caffe/python). If I have to use OpenCV in that virtualenv, I know that I just have to copy cv2.so and cv.py from OpenCV source to the env_name/lib/pythonX.X/site-packages folder. Can something similar be done for Caffe? If so, which all files needs to be copied?
pycaffe itself won't be installed in your virtualenv - you'll still have to set your PYTHONPATH to get that to work right.
If you wanted to install pycaffe to your virtualenv (or system-wide, for that matter), we would need to add a setup.py script like I suggested at https://github.com/BVLC/caffe/issues/2440#issuecomment-106100614.
I'm not sure how linking to the right .so file would work - you bring up a good point. Ideally, the Caffe libs would be installed to /usr/lib with a debian/RPM installer.
Most helpful comment
I don't see anything that needs to change in Caffe.