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
3 answers

changing the python version used in a virtualenv

i've got a project in a virtualenv, which uses python2.6, but now i'd like to make it use python2.7. Is there a way to do this without having to backup my project files, re-create the virtualenv for the right python version, and then copy my files…
mdeous
  • 17,513
  • 7
  • 56
  • 60
4
votes
2 answers

Can't Find or create a new virtualenv

I just got Python 3.5.2 and wanted to create a virtualenv. I have done this before. Right now, I have a virtualenv on a Python2.7 project that I can still open with source bin/activate. But try as I might, from /home, or from /path/to/virtualenv,…
Malik A. Rumi
  • 1,855
  • 4
  • 25
  • 36
4
votes
2 answers

How would I confirm that a python package is installed using ansible

I am writing an ansible playbook, and I would first like to install pew, and transition into that pew environment in order to install some other python libraries. So, my playbook is going to look something like this... tasks: # task 1 - name:…
Zack
  • 13,454
  • 24
  • 75
  • 113
4
votes
1 answer

Libraries in "virtualenv" much bigger than system libraries

I use virtualenv through pew (which I think is a fantastic tool), but I noticed something strange. I have scipy system-side installed: 7,7 MiB [##########] /sparse 5,1 MiB [###### ] /special 5,1 MiB [###### ] /stats 5,0 MiB…
JPFrancoia
  • 4,866
  • 10
  • 43
  • 73
4
votes
1 answer

Create a virutalenv on another drive - Access is denied

When trying to create a virtual env on my main drive (C:\) it works fine, but on my second disk (E:\) I get a error saying: ERROR: The executable "E:\path\env\Scripts\python.exe" could not be run: [WinError 5] Access is denied. The command I'm…
4
votes
1 answer

Change matplotlib backend in Python virtualenv

I've installed a virtualenv with pyenv using Python v2.7.12. Inside this virtualenv, I installed matplotlib v1.5.1 via: pip install matplotlib with no issues. The problem is that a simple import matplotlib.pyplot as plt plt.scatter([],…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
4
votes
2 answers

Virtualenv (python) in Ubuntu 14.04 LTS on external hard drive

I am trying to create a virtualenv on my external hard drive that I use for both my Ubuntu and my Windows installation (I have a SSD and use 2TB external hard drive for anything but PC games). When I navigate to the place and try to create it with…
Nebelhom
  • 3,783
  • 4
  • 21
  • 22
4
votes
3 answers

Linking to brew openssl via python virtualenvwrapper

Running openssl version returns the standard openssl on OS El Capitan, OpenSSL 0.9.8zh in /usr/bin/openssl. I've installed the latest via brew brew install openssl. Various post/articles recommended manually symlinking to /usr/local/bin/openssl or…
Piet van Leeuwen
  • 319
  • 3
  • 12
4
votes
1 answer

Python - NameError: name 'PROTOCOL_SSLv3' is not defined, when using gevent

So I had a Flask app on one machine in a virtualenv (raspberry pi running raspbian) and everything worked just fine, however when I ported it to another raspberry pi, also running raspbian, and set up a new virtualenv to the exact same…
wg4568
  • 319
  • 4
  • 15
4
votes
1 answer

virtualenv with --always-copy throws error "Operation not permitted"

I'm trying to run virtualenv without symlinking python2.7 but I get permission errors when I use the flag --always-copy. virtualenv --always-copy myenv Traceback (most recent call last): File "/usr/local/bin/virtualenv", line 11, in
Cherif
  • 63
  • 1
  • 1
  • 8
4
votes
1 answer

ImportError: No module named responses

I'm running py.tests from a virtual env. getting ImportError: No module named responses after pip freeze i see responses are installed pip freeze …
Ohad Perry
  • 1,315
  • 2
  • 15
  • 26
4
votes
1 answer

How to solve the issue of the conflict of anaconda and virtualenv

I was using virtualenv all the time and then I had also installed anaconda. Just now I tried to activate a virtual environment using the way of anaconda like source activate helloworld. (Indeed I don't remember if this is exactly the command I typed…
user5779223
  • 1,460
  • 3
  • 21
  • 42
4
votes
1 answer

Import issue with Python six library

inside my virtualenv I have a lot of libraries that use six as dependency but paramiko and python-keystoneclient raise this import error: ERROR:paramiko.transport:Unknown exception: cannot import name urllib_parse ERROR:paramiko.transport:Traceback…
alauri
  • 317
  • 1
  • 4
  • 17
4
votes
2 answers

Setting environment variables in virtualenv (Python, Windows)

As the title suggests, I'm trying to use a environment variable in a config file for a Flask project (in windows 10). I'm using a virtual env and this far i have tried to add set "DATABASE_URL=sqlite:///models.db" to /Scripts/activate.bat in the…
jst_swe
  • 51
  • 3
4
votes
0 answers

Installing numpy in virtualenv on raspbian

I'm running a raspberry pi3 and created a virtualenv. I'm using pip to install numpy. I'm following the steps shown in this link I'm getting stuck with an error and not able to proceed, any ideas on a solution? Pastebin for the error
Collins
  • 231
  • 2
  • 14