In this tutorial (3.16), after downloading and then running graphical installer from from main anaconda website and then typing on mac's terminal:
$ python
Python 3.5.2 |Anaconda 4.1.1 (x86_64)|...
However, when I do the same thing, it gives me the following:
JOHNMAC:~ Main$ python
Python 2.7.13 (default, Apr 4 2017, 08:46:44)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more
information.
For more info...
JOHNMAC:~ Main$ python3
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Checking $PATH:
JOHNMAC:~ Main$ echo $PATH
/usr/local/bin:/usr/local/sbin:/Users/Main/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Conda info:
JOHNMAC:~ Main$ conda info
Current conda install:
platform : osx-64
conda version : 4.3.22
conda is private : False
conda-env version : 4.3.22
conda-build version : not installed
python version : 3.6.1.final.0
requests version : 2.14.2
root environment : /Users/Main/anaconda (writable)
default environment : /Users/Main/anaconda
envs directories : /Users/Main/anaconda/envs
/Users/Main/.conda/envs
package cache : /Users/Main/anaconda/pkgs
/Users/Main/.conda/pkgs
channel URLs : https://repo.continuum.io/pkgs/free/osx-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/osx-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/osx-64
https://repo.continuum.io/pkgs/pro/noarch
config file : /Users/Main/.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.22 requests/2.14.2 CPython/3.6.1 Darwin/15.6.0 OSX/10.11.6
UID:GID : 501:20
Try typing which python
to see where the python binary is coming from.
Because Unix looks up binaries in PATH order, it will check for python in /usr/local/bin
first, and use the preinstalled python instead of the python installed by Anaconda at /Users/Main/anaconda/bin/python
.
To fix this, you can change your PATH order by running:
export PATH=/Users/Main/anaconda/bin:/usr/local/bin:/usr/local/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
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.