Python3 Virtualenv Setup
Requirements
- Python 3
- Pip 3
$ brew install python3
Pip3 is installed with Python3
Installation
To install virtualenv via pip run:
$ pip3 install virtualenv
Usage
Creation of virtualenv:
$ virtualenv -p python3 <desired-path>
Activate the virtualenv:
$ source <desired-path>/bin/activate
Deactivate the virtualenv:
$ deactivate
@raitisd: Well, that's the idea.
For some reason,
brew
recently decided thatpython
refers topython3
instead ofpython2
.It's a pain in the ass.
Here, I wrote you a little script:
The output should look like this:
If it does, it should be fixed.
The copy of
python
that belongs to the OS still lives here:/usr/bin/python