Reputation: 93
I am following instruction to create Mac app with Python. I was installing Virtualenv as a part of it, as here says. I successfully did till second step; pip install, bash_profile. But when I try to Enable the virtual environment part, I get a. no file or directory / b&c. command not found, for each step.
By the way, this is the first time I heard .bash_profile, so the script is empty except what I did at the second step.
How can I fix the problem?
Upvotes: 3
Views: 7492
Reputation: 10946
Follow simple steps
pip install virtualenv
virtualenv <venv name>
source venv/bin/activate
another way of creating a venv in python 3 only
python -m venv <venv name>
source venv/bin/activate
Upvotes: 7
Reputation: 11487
I suggest you read Virtualenv User Guide.
Install virtualenv by using pip install virtualenv
virtualenv ENV
to create virtual environment.
Where ENV
is a directory to place the new virtual environment.
source bin/activate
to activate script.
And type deactivate
to undo the changes.
Add three lines to your shell startup file (
.bashrc
,.profile
, etc.) to set the location where the virtual environments should live, the location of your development project directories, and the location of the script installed with this package:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
Run source ~/.bashrc
to reload the startup file.
Upvotes: 1