- #How to install python on mac properly how to
- #How to install python on mac properly software
- #How to install python on mac properly password
If your file already contains text, then use the down arrow key to navigate to the end of the file (do not modify existing lines). This will open the file in the nano text editor, which will look like this: Nano editor Start by copying the contents of the “eval” line to your clipboard (highlight it, right click and select Copy): Line which you need you need to copyįor example, if you see what’s displayed in the screenshot above, you would type: nano ~/.zshrc
Next we need to add the line starting with “eval” to the file path displayed after “# the following to”. What if you closed the window or don’t see any output?ĭon’t worry, it happens… Simply open a new Terminal and run the below command to show it again: pyenv init What you see may be different from the screenshot above, because the output depends on your Terminal configuration.įor example, instead of ~/.zshrc, your may see ~/.profile or ~/.bashrc. Now we need to configure PyEnv so it loads when we open our Terminal. Important! Take note of the two outputs highlighted above (they may be different on your machine). Once installation is complete, you’ll see something like this: Screenshot of output after PyEnv is installed. pyenv – this is the name of the package we want to install (Tip: you can find other packages by using the search on brew.sh).install – this is the command that tells (Home)brew that we want to install something.brew – this is the package manager we installed above.In-case you’re curious, I’ll translate the command below: This can be done by running the command below: brew install pyenv Screenshot of typing the pyenv installation command Once Homebrew is installed, we can use it to install PyEnv. Once it’s done, you should see something like this: Brew installed successfully.
#How to install python on mac properly password
You’ll need to enter your administrator password and follow the on-screen instructions: Screenshot of Terminal after pasting Brew.sh installation command. This one-line command (taken from the brew.sh website) will download and run a script that will install Homebrew on your machine. To install it, copy the line below and paste it into your Terminal window: /bin/bash -c "$(curl -fsSL )"
If you haven’t used it before, Homebrew is a popular package manager for macOS. We’ll install PyEnv using a tool called Homebrew.
#How to install python on mac properly how to
How to choose which version of Python you want to use for a specific project.How to install a specific version of Python on your machine.
#How to install python on mac properly software
Using this tool, you can take advantage of all the latest features of Python 3.9, meanwhile ensuring that software requiring older versions of Python (like 2.7) continue to work on your machine. PyEnv is a useful open source tool for managing multiple Python versions on your machine. In other words, if you remove this version - things may break.Īlso, if you use Python professionally, you’ll likely need to use specific versions for different projects, so it’s useful to be able to switch versions as needed.
This is not recommended because there may be some software on your macOS which requires Python 2.7 to run. So you might be thinking: Why not remove the old version (2.7) and replace it with a newer version like 3.9 using the traditional installation method? However, the version installed is usually 2.7, which was deprecated on January 1st 2020.