-
Notifications
You must be signed in to change notification settings - Fork 2
Contribute
Steve edited this page Mar 2, 2021
·
13 revisions
- See Forking projects
$ which python3
/usr/local/bin/python3If you do not have python3 installed anywhere, see
The Hitch-Hiker's Guide To Python
to learn how to properly install Python 3.
TBD—but should be a lot like Mac OS X (which is a unix-like OS)
-
Install Apple Command Line Tools to build python
Accept license and install Xcode
$ sudo xcode-select install
-
Install
pythonwith 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
pip3package installer is availableNote: I had a copy of
/usr/local/bin/pipthat 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
virtualenvdependency 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
venvfor 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