简体   繁体   English

将Anaconda2设置为默认值,而不是Windows上的“官方” python 2.7

[英]Set Anaconda2 as default instead of the 'official' python 2.7 on Windows

I have both Anaconda2 and Python2.7 installed on my computer (the Python2.7 was downloaded and installed directly form the www.python.org website). 我的计算机上同时安装了Anaconda2和Python2.7(已从www.python.org网站直接下载并安装了Python2.7)。 I want to use Anaconda2 and not Python2.7 to run my .py files (because Anaconda2 has some libraries that Python2.7 doesn't). 我想使用Anaconda2而不是Python2.7来运行我的.py文件(因为Anaconda2具有Python2.7所没有的某些库)。 However, the default compiler seems to be the one from Python2.7, even though I've added anaconda2 to my PATH (in Environment Variables). 但是,即使我已经将anaconda2添加到我的PATH中(在环境变量中),默认的编译器似乎也是Python2.7中的编译器。 I've also tried deleting python2.7 from the PATH. 我也尝试过从PATH删除python2.7。

Has this happen to anyone and how did you resolve it? 这发生在任何人身上,您如何解决?

Thank you all! 谢谢你们!

Edit: I'm using Windows 7. 编辑:我正在使用Windows 7。

If you want to start the .py files with a double click you have to associate the python interpreter (its an interpreter not a compiler, because it doesn't generate an binary file (.exe)) with the file extension. 如果要双击启动.py文件,则必须将python解释器(其解释器不是编译器,因为它不会生成二进制文件(.exe))与文件扩展名关联。 You can do this if you right click on the file in the file explorer and select open with. 如果右键单击文件资源管理器中的文件,然后选择打开方式,则可以执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM