virtualenvwrapper

Rename an environment with virtualenvwrapper

Rename an environment with virtualenvwrapper Question: I have an environment called doors and I would like to rename it to django for the virtualenvwrapper. I’ve noticed that if I just rename the folder ~/.virtualenvs/doors to django, I can now call workon django, but the environment still says (doors)hobbes3@hobbes3. Asked By: hobbes3 || Source Answers: if …

Total answers: 2

How to freeze packages installed only in the virtual environment?

How to freeze packages installed only in the virtual environment? Question: How to freeze packages installed only in the virtual environment, that is, without the global ones? Asked By: saul.shanabrook || Source Answers: Install whatever you need to freeze in your virtual environment, and then pip freeze > requirements.txt After that install the packages in …

Total answers: 8

virtualenvwrapper functions unavailable in shell scripts

virtualenvwrapper functions unavailable in shell scripts Question: So, once again, I make a nice python program which makes my life ever the more easier and saves a lot of time. Ofcourse, this involves a virtualenv, made with the mkvirtualenv function of virtualenvwrapper. The project has a requirements.txt file with a few required libraries (requests too …

Total answers: 8

Using different versions of python with virtualenvwrapper

Using different versions of python with virtualenvwrapper Question: I’ve got various versions of python installed on my Mac using Macports. When I’ve selected python 2.7 via $ port select python python27, virtualenvwrapper works perfectly. But if I select another version of python, i.e. 2.6, virtualenvwrapper generates an error message: ImportError: No module named virtualenvwrapper.hook_loader I …

Total answers: 5

Python – manually install package using virtualenv

Python – manually install package using virtualenv Question: I have a python program I want to install into my virtualenv – it’s a zip package that I need to unzip and then run a setup.py program – but my question is more regarding how to get these unzipped files into my virtualenv so that the …

Total answers: 4

How to set virtualenv for a crontab?

How to set virtualenv for a crontab? Question: I want to set up a crontab to run a Python script. Say the script is something like: #!/usr/bin/python print “hello world” Is there a way I could specify a virtualenv for that Python script to run in? In shell I’d just do: ~$ workon myenv Is …

Total answers: 4

How to use MySQLdb with Python and Django in OSX 10.6?

How to use MySQLdb with Python and Django in OSX 10.6? Question: This is a much discussed issue for OSX 10.6 users, but I haven’t been able to find a solution that works. Here’s my setup: Python 2.6.1 64bit Django 1.2.1 MySQL 5.1.47 osx10.6 64bit I create a virtualenvwrapper with –no-site-packages, then installed Django. When …

Total answers: 23

Installing virtualenvwrapper on Windows

Installing virtualenvwrapper on Windows Question: I’ve installed virtualenv and virtualenvwrapper on Windows using easy_install. But mkvirtualenv is missing. I tried to search on my machine but I couldn’t find it. I don’t know how to solve it. Do you have any idea? Asked By: pocoa || Source Answers: mkvirtualenv is a bash script so you …

Total answers: 6

Use different Python version with virtualenv

Use different Python version with virtualenv Question: How do I create a virtual environment for a specified version of Python? Asked By: Ulf || Source Answers: NOTE: For Python 3.3+, see The Aelfinn’s answer below. Use the –python (or short -p) option when creating a virtualenv instance to specify the Python executable you want to …

Total answers: 41

How to leave/exit/deactivate a Python virtualenv

How to leave/exit/deactivate a Python virtualenv Question: I’m using virtualenv and the virtualenvwrapper. I can switch between virtualenv’s just fine using the workon command. me@mymachine:~$ workon env1 (env1)me@mymachine:~$ workon env2 (env2)me@mymachine:~$ workon env1 (env1)me@mymachine:~$ How do I exit all virtual environments and work on my system environment again? Right now, the only way I have …

Total answers: 14