Question

from this question:

Manage python version in different virtualenv with pythonbrew

I followed the instructions of the answer and typed in:

pythonbrew venv create project1

After doing this, virtualenv was installed and this new venv was installed here:

user/.pythonbrew/venvs/Python-2.7.6/project1

What I would like to know is how I would be able to install dependencies within this virtualenv using pip?

Based on my current knowledge, I would assume that running the command to install dependencies from the generic terminal spot (user/) will make the dependencies get installed in the main pythonbrew install and not the virtual environment.

I am building multiple web projects using different python tools (but the same/latest python 2.7 version), so I would like to keep each project(and their different dependencies) separate.

No correct solution

OTHER TIPS

Simply use that project's pip to install desired module.

In your case, for example:

user/.pythonbrew/venvs/Python-2.7.6/project1/bin/pip install mpipe

Dump the newly installed module's version:

user/.pythonbrew/venvs/Python-2.7.6/project1/bin/python -c 'import mpipe; print(mpipe.__version__)'

Output is:

1.0.7

I think I have found the ideal solution here:

https://pypi.python.org/pypi/pythonbrew/

By running this:

pythonbrew venv use proj

And then running:

pip install -U django==x.x.x

It will install a dependency like django into the virtual environment, even if you have other versions of it.

You are correct in thinking that running pip in the terminal will update the entire system while running it in particular environment will only update that particular virtual environment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top