简体   繁体   中英

PyDev with Virtualenv: Interpreter not found

I am having trouble getting PyDev to work with Virtualenv. I have:

  1. Created a PyDev project. At that point I am forced to specify an interpreter, so I choose the installed system Python 2.7 interpreted. 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.
  3. Removed the standard interpreter I added in the first step and tried to add the one located in my venv directory. But I can not seem to get it to work.

In more detail:

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

The result when I try to add the interpreter in my venv directory as well as the necessary libraries there. 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 ): 错误:找不到翻译

How should I configure PyDev to make it play nicely with 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'.

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')

Or you can set your project to use the default interpreter (ie: select project > alt + enter > pydev - interpreter/grammar > interpreter: Default).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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