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

Python3: install in virtualenv fails

I tried to create Python3 virtualenv and test some Python code in it: python3 -m venv tbzuploader-py3env cd tbzuploader-py3env . ./bin/activate pip install -e git+https://github.com/guettli/tbzuploader.git#egg=tbzuploader Here is the output I…
guettli
  • 25,042
  • 81
  • 346
  • 663
4
votes
0 answers

Install package via pip in virtual env: Permission denied

Note: I also followed the same steps on a Ubuntu Desktop 16.04 but didn't get any error. I'm on Ubuntu Server 16.04. I am logged in as "user1" who has sudo privileges. I installed Python 3.6.2 from source: $ sudo apt install build-essential…
user8536725
  • 76
  • 1
  • 9
4
votes
3 answers

How do you create a virtualenv using python installed by pyenv

I have 2 pyenv versions installed pyenv versions system * 2.7 (set by ../.python-version) 3.5.3 when I am creating a virtualenv inside my project directory, I want it to create a virtualenv for the current pyenv python version 2.7 but when i'm…
Ohad Perry
  • 95
  • 2
  • 5
4
votes
2 answers

IOError: [Errno 13] Permission denied: '/usr/local/lib/netscape/mime.types'

I am creating a virtual environment using mkvirtualenv, and I get this error, where have I gone wrong? $ mkvirtualenv data New python executable in /home/usman/.virtualenvs/data/bin/python Installing setuptools, pip, wheel... Complete output from…
4
votes
0 answers

virtualenv ImportError: No module named _struct

I am trying to run virtualenv on fedora. I get the following output. in the same session I did PYTHONHOME=/usr/bin/python2.7 and PYTHONPATH=/lib/python2.7 Traceback (most recent call last): File "/usr/bin/virtualenv", line 7, in from…
Grayden Hormes
  • 855
  • 1
  • 15
  • 34
4
votes
2 answers

Virtualenv says "root" instead of the name of virtualenv?

For a while, I have been using virtualenv's for many python projects. When I tried to activate one of my virtualenv's, I typed: source venv/bin/activate Which generally does the trick. However, instead of my command prompt…
Davis Keene
  • 213
  • 1
  • 5
  • 12
4
votes
1 answer

Tkinter in a virtualenv on Mac?

This has been asked already but no answer has been supplied for computers running Mac OSX. How can I enable tkinter in a python 2.7 virtualenv on mac? TKinter in a Virtualenv
adamcircle
  • 694
  • 1
  • 10
  • 26
4
votes
4 answers

Associating a python project with a virtual environment

been searching for this with no success, i don't know if i am missing something but i have a virtualenv already but how do i create a project to associate the virtualenv with, thanks P.S. Am on windows
lulliezy
  • 1,741
  • 5
  • 24
  • 49
4
votes
2 answers

binding virtualenv to project using setvirtualenvproject command doesn't work (windows)

I'm trying to bind my virtualenv to django project. So when I type the command workon my_project it should cd to my django project. (my_project) C:\User\User\Desktop\Project> (my_project)…
Neptunas
  • 133
  • 6
4
votes
2 answers

How to use android's repo tool for Python?

I have N git repos installed in my virtualenv via pip install -e git+https://.... The git repos are in this directory: $VIRTUAL_ENV/src/ I would like to have a tool to manage all git repos at once. How can I manage N git repos in $VIRTUAL_ENV/src at…
guettli
  • 25,042
  • 81
  • 346
  • 663
4
votes
2 answers

AWS lambda says it supports python 2.7 and 3.6 but 3.6 isn't in the amazon linux ami's repos

I'm a little confused about this. If I try to create a new python lambda in the aws console I see this: Now I want to use python 3.6 and I also want to package up some binaries with a virtualenv (I'll have to do this to run the cryptography…
red888
  • 27,709
  • 55
  • 204
  • 392
4
votes
0 answers

Can I have multiple minor versions of python as well with pyenv and tox

I installed python 2.6.9, 2.7.10, 2.7.11, 2.7.12 with Pyenv, but when I check ~/.pyenv/shims/, it has only one python2.7 which points to 2.7.10. My system has python 2.7.13 installed. When I use tox to use py2710, py2711, py2712, it uses system's…
abhijitjaiswal
  • 139
  • 1
  • 8
4
votes
1 answer

Add existing virtualenv to virtualenvwrapper

Before I install virtualenvwrapper, I have some virtualenv installed in different location. Is there any way to collect them in virtualenvwrapper so that appear in workon command?
Mahdi Ne
  • 266
  • 3
  • 9
4
votes
1 answer

Error when installing python packages using 'pip install -r requirements.txt'

I am trying to set up a test virtual environment but I am having issues when installing packages using pip install -r requirements.txt. Here is the output to the console... (test.env)[ django@hostname ~ ] $ pip install -r requirements.txt…
iNeedScissors61
  • 191
  • 1
  • 4
  • 16
4
votes
3 answers

How to pip-install Python package into virtual env and have CLI commands accessible in normal shell

For larger Python packages which might interfere with other packages it is recommended to install them into their own virtual environment and some Python packages expose CLI commands to the shell. Is there a way to pip-install such a package into…
halloleo
  • 9,216
  • 13
  • 64
  • 122