简体   繁体   中英

How to use Java and python in intellij on the same project

I need to use Java and python in the same project, intellij.

When I set up the JDK, the Java code was fine,but the import of the python package failed.On the contrary, python is normal and Java is problematic

Intellij is set as follows:

enter image description here , enter image description here , enter image description here , enter image description here

The python package import failed:

enter image description here

I see several methods on stackoverflow:

I changed the SDK to python3.6 in Project Structure->Modules->Dependencies->Module SDK and The Java JDK is still included in the Project Structure->Project->Project SDK ,but it is useless

I've set up the Python interpreter for the actual Facets and in Project Structure->Facets and restart intellij,But it doesn't work

Can I set up python and Java SDK at the same time

How can I do.Thanks in advance

You need to "Add framework support" / Facets

As long as you already have python installed, just follow this.

Right-click the directory/module/project where you have your python scripts, right at the top you will see "Add framework Support..."

https://www.jetbrains.com/help/idea/adding-support-for-frameworks-and-technologies.html#disable-framework-auto-detection

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