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

前端 未结 7 852
北海茫月
北海茫月 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-24 02:29

    Set your python path to the Anaconda version instead

    Windows has a built-in dialog for changing environment variables (following guide applies to XP classical view): Right-click the icon for your machine (usually located on your Desktop and called “My Computer”) and choose Properties there. Then, open the Advanced tab and click the Environment Variables button.

    In short, your path is:

    My Computer ‣ Properties ‣ Advanced ‣ Environment Variables In this dialog, you can add or modify User and System variables. To change System variables, you need non-restricted access to your machine (i.e. Administrator rights).

    Find your PATH variable and add the location of your Anaconda directory.

    Example of someone doing it here: How to add to the PYTHONPATH in Windows, so it finds my modules/packages? Make sure that you sub path out for the Anaconda file though.

提交回复
热议问题