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
1 answer

Cannot import modules using Virtualenv in Vagrant

This is my first time trying to set up a vagrant environment or a python virtuelenv, so forgive me if I am missing something basic. Right now, I ssh into my vagrant box and in the home directory I have placed my venv folder. I have run source…
roach
  • 73
  • 7
4
votes
1 answer

Installing virtualenv virtualenvwrapper with pip on osx 10.11.1

Objective Install virtualenv virtualenvwrapper Background I am trying to create a sample flask app by following this tutorial https://realpython.com/blog/python/flask-by-example-part-1-project-setup/ But I am running into constant issues since I am…
JGallardo
  • 11,074
  • 10
  • 82
  • 96
4
votes
2 answers

Correct gunicorn.conf to get environmental variables for Django use

I am deploying a Django app on my VPS using Nginx as the web server and Gunicorn installed in virtualenv. (I am using virtualenv with virtualenvwrapper.) When I run Gunicorn like this, environment variables (such as database password, name) can be…
Jonas
  • 534
  • 8
  • 16
4
votes
1 answer

error raised in virtualenv - dyld: Library not loaded: /Library/Frameworks/Python.framework/Versions/3.4/Python

I have the following scenario in my virtualenv. after activating my virtualenv env-trails_dj with source env-trails_dj/bin/activate and try to launch python, I get the following error: (env-trails_dj) AirTime:trails_dj udos$ python dyld: Library…
udo
  • 4,832
  • 4
  • 54
  • 82
4
votes
0 answers

Where should my virtual environment be located?

Suppose I'm starting a new Python project. Its root directory at the beginning looks like this (for this example it would be a Flask project, but the question applies to any Python project): myproject static templates I want to use…
Aviv Cohn
  • 15,543
  • 25
  • 68
  • 131
4
votes
0 answers

Can I install a C/C++ library shared object in a Python virtualenv?

I am using a C++ library which can be built as a Python module using SWIG. Building the module results in a C++ shared object, call it libFoo.so, and a Python module which includes both a Python file, Foo.py, and some shared object which is used by…
jwg
  • 5,547
  • 3
  • 43
  • 57
4
votes
2 answers

Docker: How to source a virtualenv and install requirements.txt?

I'm not sure what I'm missing here. The canonicaliser_api contains my code and a requirements.txt. FROM ubuntu:14.04.2 RUN rm /bin/sh && ln -s /bin/bash /bin/sh RUN apt-get -y update && apt-get upgrade -y RUN apt-get install python build-essential…
Houman
  • 64,245
  • 87
  • 278
  • 460
4
votes
1 answer

Virtualenv: How to make a custom Python include shared by multicomponents hosted by uWSGI

I have a somewhat intricate project setup consisting of several components that work together. Each component is a separate Python project that is hosted as a uWSGI application behind an Nginx proxy. The components interact with each other and with…
Chris Chambers
  • 1,367
  • 21
  • 39
4
votes
1 answer

make packages installed in virtualenv visibile to sphinx

I am using sphinx to document my software. and I am using a virtualenv for the installation. now some packages are only installed in the virtual environment, and sphinx does not see them. I have this code in my conf.py: # If extensions (or modules…
mariotomo
  • 9,438
  • 8
  • 47
  • 66
4
votes
0 answers

Strange relocation error occurring within a virtualenv: `python: relocation error: python: symbol Øv�l��⎼�Ø┴�┌��⎼�Ø┴�` (etc...)

I'm encountering a very mysterious error that occurs intermittently whilst I'm working within a virtualenv. Although it has now happened to me 3-4 times, I'm finding it frustratingly difficult to find the conditions that will reproduce the problem.…
ali_m
  • 71,714
  • 23
  • 223
  • 298
4
votes
2 answers

Installing virtualenvwrapper-powershell in Windows 8.1, import-module failing

I'm trying to follow the guide here, and I'm stuck at Import-Module virtualenvwrapper, where PowerShell keeps giving me the error: import-module : The specified module 'virtualenvwrapper' was not loaded because no valid module file was found in…
tomato
  • 91
  • 1
  • 6
4
votes
2 answers

Django's locale files installed in weird place

I'm creating a new environment setup script for my organization, but am having problems with installing Django. After executing pip install Django==1.4.19 under virtualenv a test that requires localization support yields: ... File…
anttikoo
  • 785
  • 8
  • 20
4
votes
2 answers

Can I have 2 Django sites using 2 different version of Python on 1 domain?

I have 1 Django project using the server's default Python (2.6.6) and I have a new project that I want to use Python 2.7, and have it in a virtual env. This is the error: [client 64.136.119.142] Traceback (most recent call last): [Wed Jun 17…
User
  • 23,729
  • 38
  • 124
  • 207
4
votes
1 answer

Environment variable

I have a tox.ini file like this: [tox] envlist = {py27,py34} [testenv] setenv = PYTHONDONTWRITEBYTECODE=1 deps = -r{toxinidir}/requirements-test.txt commands = nosetests -v --stop --with-coverage --cover-package=project So, I need…
4
votes
2 answers

virtualenv not installing pip

I'm trying to install a new virtual environment in a new project folder and it's not installing pip in the virtual environment. Here is the bash log: $ virtualenv --version 12.1.1 $ sudo virtualenv venv Password: New python executable in…
Keith Yong
  • 1,474
  • 1
  • 15
  • 20