


If you want to be able to use it, use the source work/bin/activate command. By default, if you close your Terminal, the environment is deactivated. Once an environment is activated, all the install commands will apply only to the current environment. You can read more about Python environments in the documentation. Next, let’s follow best practices and create a new Python environment in which we can install NumPy and OpenCV: 1 python3.8 -m venv work 2 source work/bin/activateĪt this point, your prompt should indicate that you are using the work environment. This is what I see if I run python3.8 on my machine: 1 % python3.8Ģ Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53) 3 on darwin 4 Type "help", "copyright", "credits" or "license" for more information. python3 will also invoke the latest installer version of Python 3. If this is the case, you can select which version you want to use by specifying the version number, e.g.: 1 python3.7Īfter the above, you can invoke Python 3.8 using the python3.8 command. You can also check the video version of this tutorial if you want to see how I did it.Īs a side note, you can have multiple Python 3 versions installed on your macOS machine. The official installer of Python is a pkg file that will start a GUI installer which will guide you through the installation. Once the Command Line Tools are installed, we can install Python. Open a Terminal and write: 1 xcode-select -install Please note, that you will need the Command Line Tools even if you’ve already installed Xcode. Start by installing the Command Line Tools for macOS. In this tutorial, we’ll use the Python 3.8. Python 3.x is the future and it is supported by all major Python libraries. MacOS comes by default with Python 2.7 which, at this point, receives only bug fixes and will be EOL by 2020.
