Skip to content
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

virtualenv request #2450

Closed
lababidi opened this issue May 12, 2015 · 7 comments
Closed

virtualenv request #2450

lababidi opened this issue May 12, 2015 · 7 comments
Labels

Comments

@lababidi
Copy link

Could caffe be structured in a way such that the python dependencies reside in a virtualenv?

@n-zhang n-zhang added the JL label May 12, 2015
@hobbes26
Copy link

Is this happening soon?

@lukeyeager
Copy link
Contributor

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.

@lababidi
Copy link
Author

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.

@lukeyeager
Copy link
Contributor

what's with the for loop?

#1950 (comment)

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

@lababidi
Copy link
Author

+1 @lukeyeager

@hobbes26
Copy link

@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?

@lukeyeager
Copy link
Contributor

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 #2440 (comment).

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants