2017-09-10 1 views
-1

방금 ​​Mac을 지우고 macOS를 다시 설치했습니다.기본 파이썬을 내기 위해 자작 나무 파이썬을 설정할 수 없습니까?

Homebrew를 설치 한 다음 brew install python과 함께 Python을 설치했습니다. 하지만 지금 which python을 사용하면 /usr/bin/python이됩니다. echo $PATH을 입력하면 usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin을 반환합니다.

내 .bash_profile에 파일을

# Load the shell dotfiles, and then some: 
# * ~/.path can be used to extend `$PATH`. 
# * ~/.extra can be used for other settings you don’t want to commit. 
for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do 
    [ -r "$file" ] && source "$file" 
done 
unset file 

# Brew Cask install location 
export HOMEBREW_CASK_OPTS="appdir=~/Applications" 

내 .path 파일 :

PATH="/usr/local/bin:$PATH" 
export PATH 

내가 기본값으로 브루 파이썬을 설정하려면 어떻게해야합니까?

브루와 // 편집 나는 방금 설치 한 루비

그것은 작동하지만 파이썬은하지 않습니다 ...

// EDIT2 당신은, 당신의 $PATH을 수정 사제 때의 출력을 확인해야 some adjustments

+1

어딘가에 오타가 있습니다 : 요청한 출력의'usr/local/bin'은'/ usr/local/bin'과 다릅니다. – chepner

+0

어떤 파일에있을 수 있습니까? .bash_profile과 .path에서 하나를 찾을 수 없습니다. – VenatorScientiae

+0

경로가 꽤 일치하지 않는 것 같습니다. 자작과 함께 시작한다면, 당신의 인생을 더 단순하게 만들 것입니다. 로컬, 비 특권 접두어. – pvg

답변

0

설치 파이썬 brew install python는 :

이 같은
==> Caveats 
This formula installs a python2 executable to /usr/local/bin. 
If you wish to have this formula's python executable in your PATH then add 
the following to ~/.zshrc: 
    export PATH="/usr/local/opt/python/libexec/bin:$PATH" 

Pip and setuptools have been installed. To update them 
    pip2 install --upgrade pip setuptools 

You can install Python packages with 
    pip2 install <package> 

They will install into the site-package directory 
    /usr/local/lib/python2.7/site-packages 

See: http://docs.brew.sh/Homebrew-and-Python.html 

뭔가 작업을해야합니다 :

export PATH="/usr/local/opt/python/libexec/bin:$HOME/Library/Python/2.7/bin:$HOME/Library/Python/3.6/bin:..." 
관련 문제