virtualenv
Virtual Python Environment builder
Virtualenv — virtualenv 13.1.2 documentation
Is it this, which people seem to recommend most often:
$ sudo apt-get install python-setuptools
$ sudo easy_install pip
$ sudo pip install virtualenv
Or this, which I got from http://www.pip-installer.org/en/latest/installing.html:
$ curl -O https://github.com/pypa/virtualenv/raw/master/virtualenv.py
$ python virtualenv.py my_new_env
$ . my_new_env/bin/activate
(my_new_env)$ pip install ...
Or something entirely different?
Source: (StackOverflow)
I know about virtualenv and pip. But these are a bit different from bundler/carton.
For instance:
- pip writes the absolute path to shebang or activate script
- pip doesn't have the
exec
sub command (bundle exec bar
)
- virtualenv copies the Python interpreter to a local directory
Does every Python developer use virtualenv/pip? Are there other package management tools for Python?
Source: (StackOverflow)
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
.
Source: (StackOverflow)
I've created folder and initialized a virtualenv instance in it.
$ mkdir myproject
$ cd myproject
$ virtualenv env
When I run (env)$ pip freeze
, it shows the installed packages as it should.
Now I want to rename myproject/
to project/
.
$ mv myproject/ project/
However, now when I run
$ . env/bin/activate
(env)$ pip freeze
it says pip is not installed. How do I rename the project folder without breaking the environment?
Source: (StackOverflow)
I created an environment with the following command: virtualenv venv --distribute
I cannot remove it with the following command: rmvirtualenv venv
I do an ls
on my current directory and I still see venv
The only way I can remove it seems to be: sudo rm -rf venv
Note that the environment is not active. I'm running Ubuntu 11.10. Any ideas? I've tried rebooting my system to no avail.
Source: (StackOverflow)
I'm able to update pip-managed packages, but how do I update pip itself? According to pip --version
, I currently have pip 1.1 installed in my virtualenv and I want to update to the latest version.
What's the command for that? Do I need to use distribute or is there a native pip or virtualenv command? I've already tried pip update
and pip update pip
with no success.
Source: (StackOverflow)
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:~$
However, how do I exit all virtual machines and workon my real machine again? Right now, the only way I have of getting back to
me@mymachine:~$
is to exit the shell and start a new one. That's kind of annoying. Is there a command to workon "nothing", and if so, what is it? If such a command does not exist, how would I go about creating it?
Source: (StackOverflow)
I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries?
Source: (StackOverflow)
Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects' dependencies aren't all thrown together into a common pile.
But if I want to install a package on Windows that's packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I have pycuda-0.94rc.win32-py2.6.exe. When I run it, it examines the registry, and finds only one Python26 to install into, the common one that my virtualenv is based off of.
How can I direct it to install into the virtualenv?
Source: (StackOverflow)
I have created a virtualenv using the --no-site-packages
option and installed lots of libraries. Now I would like to revert the --no-site-packages
option and use also the global packages.
Can I do that without recreating the virtualenv?
More precisely:
I wonder what exactly happens when creating a virtualenv using the --no-site-packages
option as opposed to not using that option.
If I know what happens then I can figure out how to undo it.
Source: (StackOverflow)
I've been hearing the buzz about virtualenv lately, and I'm interested. But all I've heard is a smattering of praise, and don't have a clear understanding of what it is or how to use it.
I'm looking for (ideally) a follow-along tutorial that can take me from Windows or Linux with no Python on it, and explain every step of (in no particular order):
- what I should do to be able to start using
virtualenv
- specific reasons why using
virtualenv
is a good idea
- situations where I can/can't use
virtualenv
- situations where I should/shouldn't use
virtualenv
And step through (comprehensively) a couple sample situations of the should+can variety.
So what are some good tutorials to cover this stuff? Or if you have the time and interest, perhaps you can answer a few of those questions here. Either in your answer, or as a link to tutorials that answer it, these are the things I'd like to know.
Source: (StackOverflow)
I have a Heroku project that uses environment variables to get its configuration, but I use virtualenv to test my app locally first.
Is there a way to set the environment variables defined on the remote machine inside virtualenv?
Source: (StackOverflow)
I have a shared account in a web-hosting that has Python 2.4 installed, but my code is not compatible with 2.4. Is it possible to install Python 2.6 directly to Virtualenv?
Note: I donĀ“t have permission to install it in the shared server.
Source: (StackOverflow)
I've searched the wiki modules page, but i can't find anything similar to virtualenv (python) or rvm.
Anyone here separates node.js in their own env? I really don't like to install npm system-wide.
Source: (StackOverflow)
Is it possible to determine if the current script is running inside a virtualenv environment?
Source: (StackOverflow)