简体   繁体   中英

Problems with python plugin for Intellij IDEA

I installed python plugin for Intellij IDEA.

  • IDEA version: 14.1.4
  • Plugin version: 4.5.141.1624

I am on Windows 7 and I have installed python to C:\\Python34 . Python is added to my PATH variable too.

When I edit python files on IDEA, it shows various errors in my python scripts. Following are some of them.

在此处输入图片说明

How can I get rid of these errors?

Here is my python console settings. I cannot set a python interpreter. There's no items in the dropdown.

在此处输入图片说明

I had the similar problem when I did not define SDK for project during creation of python project. Unfortunately I could not find any option in settings to do so. But I found some solution. Maybe it is little bit work around but it worked for me.

  1. I just created new project by using File/New/Project
  2. I selected Python type of project and click New to define Project SDK (Unfortunately I could not post picture with example I am pretty new in SO)

After that Idea configured itself in such way that in my old project I was also able to select this SDK. I tried to define such SDK by edition of settings file of IDEA but I was not able to do this in such way.

After defining few SDK It is also possible to change it for one of your module even if you did not do this on the beginning. You just need to:

  1. open configuration file for module module_name.iml file
  2. find there line <orderEntry type="inheritedJdk" />
  3. change it to description of on of Python SDK for example <orderEntry type="jdk" jdkName="Python 3.4.3 (F:\\Python34\\python.exe)" jdkType="Python SDK" />

I hope that this will help.

I am using: InteliJ IDEA 14.1.4
Python Community Edition plugin version 4.5.2 141.106
And python 3.4.3

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