Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 stack overflow:

I changed the SDK to python3.6 inProject Structure->Modules->Dependencies->Module SDKand 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?

like image 900
guiniao Avatar asked Oct 17 '22 09:10

guiniao


1 Answers

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

like image 79
Miguel Armenta Avatar answered Oct 21 '22 00:10

Miguel Armenta