-
Notifications
You must be signed in to change notification settings - Fork 2
Contribute
Steve edited this page Mar 13, 2021
·
13 revisions
- See Forking projects
$ which python3
/usr/local/bin/python3
If you do not have python3
installed anywhere, see
The Hitch-Hiker's Guide To Python
to learn how to properly install Python 3.
$ which python3
-
Install Apple Command Line Tools to build python
Accept license and install Xcode
$ sudo xcode-select install
-
Install
python
with Homebrew$ brew install python
$ which python3 /usr/local/bin/python3
$ python3 --version Python 3.9.1
$ python3 -m site --user-base /Users/steve/Library/Python/3.9
-
Ensure
pip3
package installer is availableNote: I had a copy of
/usr/local/bin/pip
that I had to remove—maybe from a previous installation(?)$ which pip3 /usr/local/bin/pip
$ pip3 --version pip 20.3.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
-
Install
virtualenv
dependency manager to isolate your python apps from other environments$ pip3 install virtualenv virtualenvwrapper
$ virtualenv --version virtualenv 20.2.2 from /usr/local/lib/python3.9/site-packages/virtualenv/__init__.py
-
Create a
venv
for your project$ mkvirtualenv --python=`which python3` moo
[moo]$ which python /Users/steve/.virtualenvs/moo/bin/python
[moo]$ python --version Python 3.9.1
To remove a
venv
:[moo]$ deactivate $ rmvirtualenv moo
-
Work on project:
$ workon moo [moo]$
TBD