简体   繁体   中英

Difference of using activate & directly call python in anaconda virtual environment

I first install anaconda2, then install anaconda3 in envs.

E:\>conda info -e

# conda environments:
#
base                  *  D:\Anaconda2
py3                      D:\Anaconda2\envs\py3

Then I want to execute a python3 script test.py . There maybe 2 methods to do that:

1.

E:\>activate py3

(py3) E:\>python test.py
hello world

(py3) E:\>deactivate

2.

E:\>D:\Anaconda2\envs\py3\python test.py
hello world

What's the difference? What's the suggested way or any potential issue if I use one of them?

Both are same. Activate helps you with not having to type in the full path to python interpreter everytime

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