简体   繁体   English

设置默认解释器并在 PyCharm 2017 中不使用 virtualenv

[英]Set a Default Interpreter and use NO virtualenv in PyCharm 2017

I'm on Ubuntu 16.04.我在 Ubuntu 16.04。 I went to File > Default Settings > Project Interpreter > add local and browsed to my anconda3/long/path/python3.6 .我转到File > Default Settings > Project Interpreter > add local并浏览到我的anconda3/long/path/python3.6 When I open a new project or file the anaconda interpreter is NOT chosen, and instead a virtual environment based on the systems default python3 interpreter is created in /home/myname/venv and is used.当我打开一个新项目或文件时,未选择 anaconda 解释器,而是在/home/myname/venv中创建并使用基于系统默认 python3 解释器的虚拟环境。 To change it I need to go into settings, search for "interpreter" and choose the anaconda3 I added earlier, but that's a hassle!要更改它,我需要 go 进入设置,搜索“解释器”并选择我之前添加的 anaconda3,但这很麻烦!

How can I get PyCharm to use the Anaconda3 interpreter by default and avoid having those annoying virtual environments poping up in my home folder every time I need to write a script?我怎样才能让 PyCharm 默认使用 Anaconda3 解释器,并避免每次我需要编写脚本时在我的主文件夹中弹出那些烦人的虚拟环境?

This is a bit convoluted. 这有点令人费解。 When clicking File > New Project you get a pop-up window where you set the project name, under the name there is a little text saying Project Interpreter: Python 3.6 . 单击File > New Project ,会出现一个弹出窗口,您可以在其中设置项目名称,在名称下面有一个文本说Project Interpreter: Python 3.6 Click on it and some options expand. 单击它并展开一些选项。 The preset option is New Virtual Environment with the default system interpreter. 预设选项是New Virtual Environment带有默认系统解释器。 The other, not set option, is Existing Interpreter which is the one you set in the Default Settings. 另一个未设置选项是Existing Interpreter ,它是您在默认设置中设置的。

Runnig module from Pycharm's terminal can be used. 可以使用Pycharm终端的Runnig模块。 Run main interpreter (form .../Anaconda3/python.exe) and then run your module by typing "python main.py" 运行主解释器(窗体... / Anaconda3 / python.exe)然后键入“python main.py”运行您的模块

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

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