


#Python for mac installation guide install
With time some of you may want to install multiple Python versions with multiple virtual environments per version. In case you are using MacOS Mojave and you are installing Python3.6įrom brew bottle you might have a problem with pip, here's a
#Python for mac installation guide how to
Here's a little tip on how to create virtualenv with specific You should be able to use mkvirtualenv and workon commands including autocompletion. Source /usr/local/bin/virtualenvwrapper.sh bash_profile) should contain this information to work properly with installed packages: # Setting PATH for Python 3 installed by brewĮxport PATH=/usr/local/share/python:$PATHĮxport VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3Įxport VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv For example you can create a hidden directory inside ~ and called it. This is done using pip: pip3 install virtualenv virtualenvwrapperĭefine a default path for your virtual environments. Now it's time to install virtualenv and virtualenvwrapper to be able to use workon command and switch between virtual environments. To make sure you've done everything correctly run which python3 and in return you should receive /usr/local/bin/python. Add this line to youre ~/.zshrc (or ~/.bash_profile if you're using bash): export PATH=/usr/local/share/python:$PATH Now your system needs to know where to look for freshly installed Python packages. To install python with brew run: brew install python3 Configuration stepsĬheck out brew installation page or simply run this in your terminal: /usr/bin/ruby -e "$(curl -fsSL )" Main difference between installer from Python website and brew is that installer puts python packages to: /Library/Frameworks/amework/Versions/3.xīrew on the other hand installs Python, Pip & Setuptools and puts everything to: /usr/local/bin/python3.x/site-packagesĪnd though it may not make any difference to you now – it will later on. The most convenient and future-proof method to install Python on MacOS is brew. To install virtualenv and virtualenvwrapper for repetitive use you need a correctly configured Python (this example uses Python 3.x but process is identical for Python 2.x).Īlthough you can get python installer from Python website I strongly advice against it.
