简体   繁体   English

与Virtualenv PyDev:找不到口译员

[英]PyDev with Virtualenv: Interpreter not found

I am having trouble getting PyDev to work with Virtualenv. 我无法让PyDev与Virtualenv一起使用。 I have: 我有:

  1. Created a PyDev project. 创建了一个PyDev项目。 At that point I am forced to specify an interpreter, so I choose the installed system Python 2.7 interpreted. 那时我被迫指定一个解释器,所以我选择了已安装的系统Python 2.7进行解释。 When I add the interpreter the necessary library folders are added as well. 当我添加解释器时,还将添加必要的库文件夹。
  2. Issued virtualenv venv in the project directory to create a Virtualenv environment. 在项目目录中发出virtualenv venv以创建Virtualenv环境。
  3. Removed the standard interpreter I added in the first step and tried to add the one located in my venv directory. 删除了我在第一步中添加的标准解释器,并尝试添加位于我的venv目录中的标准解释器。 But I can not seem to get it to work. 但我似乎无法使其正常工作。

In more detail: 更详细地:

All directories in my PythonFlaskTemplate PyDev project: 我的PythonFlaskTemplate PyDev项目中的所有目录: 我的PythonFlaskTemplate PyDev项目中的所有目录

The result when I try to add the interpreter in my venv directory as well as the necessary libraries there. 当我尝试在venv目录以及那里的必需库中添加解释器时的结果。 Did I miss any library directory which I should have picked? 我是否错过了我应该选择的任何图书馆目录? Did I pick a directory I should not have picked? 我是否选择了我不应该选择的目录? 配置我的Python解释器的结果

And I still get an error saying that it can not find an interpreter. 而且我仍然得到一个错误,说它找不到解释器。 Even though the interpreter path I picked is correct (I can start it by ./venv/bin/python2.7 ): 即使我选择的解释器路径是正确的(我也可以通过./venv/bin/python2.7来启动它): 错误:找不到翻译

How should I configure PyDev to make it play nicely with Virtualenv? 我应该如何配置PyDev以使其在Virtualenv中很好地播放?

The problem there seems to be that you configured your project not to use the 'default' interpreter, but to use an interpreter which has to be named 'python'. 那里的问题似乎是您配置的项目不使用“默认”解释器,而是使用必须命名为“ python”的解释器。

You can fix that by changing the name of the interpreter in the interpreter preferences (ie: preferences > pydev > interpreters > python interpreter > double click it and type 'python') 您可以通过在解释器首选项中更改解释器的名称来解决此问题(即:首选项> pydev>解释器> python解释器>双击并键入“ python”)

Or you can set your project to use the default interpreter (ie: select project > alt + enter > pydev - interpreter/grammar > interpreter: Default). 或者,您可以将项目设置为使用默认解释器(即:选择项目> alt +输入> pydev-解释器/语法>解释器:默认)。

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

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