How can I execute Python scripts using Anaconda's version of Python?

前端 未结 7 857
北海茫月
北海茫月 2020-12-24 02:07

I recently downloaded the Anaconda distribution for Python. I noticed that if I write and execute a Python script (by double-clicking on its icon), my computer (running on W

7条回答
  •  北海茫月
    2020-12-24 02:30

    I like to run a "bare-bones" version of Python 2 to verify scripts that I create for other people without an advanced python setup. But Anaconda and Python 3 have a lot of nice features. To enjoy both things on the same computer I do this on my Windows computer which allows me to easily switch.

    C:\Users>python --version
    Python 2.7.11
    
    C:\Users>conda create --name p3 python=3
    
    C:\Users>conda info --envs
    Using Anaconda Cloud api site https://api.anaconda.org
    # conda environments:
    #
    p3                       C:\Anaconda3\envs\p3
    root                  *  C:\Anaconda3
    
    C:\Users>activate p3
    Deactivating environment "C:\Anaconda3"...
    Activating environment "C:\Anaconda3\envs\p3"...
    
    [p3] C:\Users>python --version
    Python 3.5.1 :: Continuum Analytics, Inc.
    

    For more info: http://conda.pydata.org/docs/test-drive.html

提交回复
热议问题