How do I set Anaconda's python as my default p

2020-07-02 10:37发布

I have both Anaconda and Python 2.7 installed on my Windows machine. Right now the command "python" points to Python 2.7, but I'd like instead for it to point to Anaconda's python. How do I set this up?

2条回答
【Aperson】
2楼-- · 2020-07-02 11:15

From the docs (https://docs.anaconda.com/anaconda/user-guide/

source <path to conda>/bin/activate
conda init

" Should I add Anaconda to the macOS or Linux PATH?

We do not recommend adding Anaconda to the PATH manually. During installation, you will be asked “Do you wish the installer to initialize Anaconda3 by running conda init?” We recommend “yes”. If you enter “no”, then conda will not modify your shell scripts at all. In order to initialize after the installation process is done, first run source /bin/activate and then run conda init. "

查看更多
叼着烟拽天下
3楼-- · 2020-07-02 11:29

Your PATH is pointing to the original Python executable. You have to update your PATH.

(Assuming Windows 7)

Right-click on Computer, the Properties, the Advanced system settings, then click the Environment Variables... button.

The lower window has the system variables. Scroll down until you find Path, select it, and click edit. In the screen that appears, update the path that is pointing to your original python.exe to the one that is in the anaconda path.

Close any open command window for update to take effect.

查看更多
登录 后发表回答