Questions tagged [virtualenv]

virtualenv is a tool that creates sandboxed Python environments.

virtualenv allows you to create a sandboxed and isolated environment where Python packages can be installed without interfering with other packages on the same machine. With several virtualenvs, many different pieces of Python software with different and even mutually exclusive dependencies can live together.

The source code of this tool is hosted on GitHub.

Basic usage:

$ virtualenv ENV
$ source ENV/bin/activate
(ENV) $ easy_install (package)
(ENV) $ deactivate
$ ...

See the Command reference for a complete list of all available commands.

7398 questions
4
votes
2 answers

How to use external libraries with virtualenv?

I'm trying to figure out how to use external libraries. I have a program that runs successfully on Spark, and I am now trying to import external libraries. I'm using virtualenv and every time I submit it, spark complains that it cannot find the…
Peter Klipfel
  • 4,958
  • 5
  • 29
  • 44
4
votes
1 answer

Python, Windows, and Multiprocessing

I have a Python program originally built on and for Linux, which I'm now trying to port over to Windows. I am running the program in a virtual environment which contains all of the dependencies (my program is installed as a wheel with pip install…
4
votes
1 answer

Virtualenvwrapper .hook: Permission Denied

I've used virtualenvwrapper previously, but I'm having problems running it on a new computer. My .bashrc file is updated per the instructions: export WORKON_HOME=$DEV_HOME/projects source /usr/local/bin/virtualenvwrapper.sh But when source is run,…
Matt Norris
  • 8,596
  • 14
  • 59
  • 90
4
votes
2 answers

Is there a way to deactivate a virtualenv inside python interpreter? i.e. analogous of deactivate_this

I have this script (this is the beginning of a wsgi script for openshift applications). This script activates a virtualenv using the in-python system environment. #!/usr/bin/python import os virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] +…
Luis Masuelli
  • 12,079
  • 10
  • 49
  • 87
4
votes
1 answer

virtualenv does not copy standard modules like shutil and urllib2

When I create a new virtualenv, virtualenv .virtualenvs/my_env, there is only a subset of the standard python modules copied/linked to the new virtualenv. For example, when I do ls -l in .virtualenvs/my_env/lib/python2.6, I see: ... ... os.py ->…
Barthelemy
  • 8,277
  • 6
  • 33
  • 36
4
votes
0 answers

nodeenv - npm doesn't install into virtualenv

I've setup a python virtualenv using virtualenvwrapper. After setup, it seems that node programs are still running from the global installs instead of using virtualenv versions. Steps: Create a virtualenv named "env" mkvirtualenv env Activate…
digitopo
  • 85
  • 2
  • 9
4
votes
1 answer

Activating virtualenv in Bash script not working

Writing a script to automate my flask environment setup. if [[ -z $1 ]]; then echo "usage: flaskup