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

How to solve HashMissing using pip in python 2.7?

While trying to install pip, virtualenv the following error occurs. Traceback (most recent call last): File "/usr/local/bin/pip", line 7, in from pip import main File…
the-run
  • 977
  • 1
  • 10
  • 21
4
votes
2 answers

Python Virtualenv

When creating a virtual environment with no -site packages do I need to install mysql & the mysqldb adapter which is in my global site packages in order to use them in my virtual project environment?
demet8
  • 1,089
  • 5
  • 14
  • 26
4
votes
0 answers

Jupyter "escapes" virtualenv via .local files. How do I mitigate this?

I've noticed on multiple occasions that Jupyter has a tendency to "escape" from a virtualenv environment and cause conflict issues in different projects. After tracking one bug involving javascript widgets, which worked in a fresh user space, but…
DeusXMachina
  • 1,239
  • 1
  • 18
  • 26
4
votes
2 answers

No module named rest_framework . Django + Docker

I've installed djangorestframework with markdown and django filter using pip in virtualenv in django docker container, checked via pip freeze. The absolute path in OS X is /Users/user/project/denv/lib/python2.7/site-packages. Added …
user3475724
4
votes
2 answers

What is the purpose of running a django application in a virtualenv inside a docker container?

What is the purpose of virtualenv inside a docker django application? Python and other dependencies are already installed, but at the same time it's necessary to install lots of packages using pip, so it seems that conflict is still unclear. Could…
user3475724
4
votes
3 answers

Downgrade virtualenv to 2.7 from 3.5.3

My virtualenv is currently configured to python 3.5.0 while the package I need to use only supports 2.7. I need a way of downgrading my python runtime to 2.7 within my virtualenv. I do have both versions available to use: First one is in my…
qarthandso
  • 2,100
  • 2
  • 24
  • 40
4
votes
2 answers

Freeze of pip requirements, NumPy and SciPy on OS X

I've got a pip requirements file that I'm using with virtualenv to automatically grab dependencies for my application. The application depends on both NumPy and SciPy and as such my pip requirements file includes: numpy==1.5.0 scipy==0.8.0 However,…
epoch
  • 1,337
  • 2
  • 15
  • 23
4
votes
2 answers

Scrapy KeyError - Can't find spider

I've got a scrapy project that will not execute with scrapy crawl from the command line. I've just moved to a new development environment on ubuntu 16.04 so I wanted to double check that the issue wasn't with my set up. To do so, I…
4
votes
1 answer

Can't activate virtualenv as non root user

I can activate my virtualenv only as root user: source myprojectenv/bin/activate -sh: 80: source: not found sudo su root@ubuntu-serv:/home/user/project# source myprojectenv/bin/activate (myprojectenv) root@ubuntu-serv:/home/user/project# How can I…
paolo
  • 359
  • 1
  • 2
  • 8
4
votes
2 answers

Google App Engine Python, virtualenv and mimetypes

I have working project built with djangoappengine and running under App Engine dev server. So I run "manage.py runserver" and all works as appreciated. All requirements (django, djangoappengine etc) are located in project root dir. Now I am trying…
Vladimir Mihailenco
  • 3,382
  • 2
  • 24
  • 38
4
votes
3 answers

Do I use `pyvenv` or `virtualenv` for creating a virtual environment?

Some guides mention pyvenv (not pyenv) when talking about virtual environments such as the official Python tutorial. Others mention virtualenv such as in the Hitchhiker's Guide to Python. I've tried pyvenv and I think that it worked as you can…
Ammar Alyousfi
  • 4,112
  • 5
  • 31
  • 42
4
votes
1 answer

Unable to install nltk in a virtual environment?

After activating the virtual environment, when I try: $ sudo pip install -U nltk it shows this message: Requirement already up-to-date: nltk in /usr/local/lib/python2.7/dist-packages Why isn't it downloading those packages? Should I use…
bazzi
  • 559
  • 1
  • 8
  • 23
4
votes
2 answers

Error while installing sentry `unable to execute 'clang': No such file or directory`

I am trying to install sentry by following the instruction from the link: However when I try to execute command pip install -U sentry, I receive the error InstallationError: Command python setup.py egg_info failed with error code 1 in…
4
votes
2 answers

Where do I store my python program files when using a virtual environment?

I created a virtual environment called .lpvenv which contains dependencies for my project. On windows, .lpvenv is basically a folder. Do I store my source code directly in this folder when working inside .lpvenv or does it not matter ? Let's say I…
Mutating Algorithm
  • 2,604
  • 2
  • 29
  • 66
4
votes
0 answers

Why does pip install the wrong version in my virtualenv?

I have created an Python virtualenv with the option --system-site-packages. But there is one package with an old version installed. The one I want to install is in an newer version with the pip command. So I change into the virtualenv and try to…
oxidworks
  • 1,563
  • 1
  • 14
  • 37