简体   繁体   中英

I need help installing Python on OSX

I'm using the steps on this webpage: http://docs.python-guide.org/en/latest/starting/install/osx/

I'm stuck on this step: "Once you've installed Homebrew, insert the Homebrew directory at the top of your PATH environment variable. You can do this by adding the following line at the bottom of your ~/.bashrc file" I cannot find this file! It's frustrating.

**MY GOAL IS to get pip running on my Mac.**

You do not have to install python on OS X. But if you need the most recent version or for some reason there is something wrong with your preinstalled version, python.org offers python-binaries at this download-page .

If you are new to python, just stick to the preinstalled version. To start the python console, call Terminal and type python and /usr/bin/python will be called.

If you just want to finish the tutorial, enter the following in Terminal:

echo 'export PATH=/usr/local/bin:/usr/local/sbin:$PATH' >> ~/.bash_profile

After starting a new Tab or restarting Terminal, bash will look for python executable in /usr/local/bin first (the directory used by homebrew) before it searches /usr/bin/ (The directory for preinstalled stuff for example)

EDIT

For PIP installation guide look here.

Try this:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
echo 'export PATH=/usr/local/bin:/usr/local/sbin:$PATH' >> ~/.bash_profile
source ~/.bash_profile
brew install python

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM