Setting up python interpreter in intellij on multilingual (scala / java / python) module
As shown in the following screenshot, python 2.7.2 sdk is configured
Also:
- the python facet has been added to the "spark-parent" module
- directory "python" was added as source root
But as you can see, all the standard python imports don't work. Note that custom intrinsically safe python classes ("pyspark") are allowed.
In response to answer from Dwight Brown: Changing project SDK from java to python doesn't work in this mixed project: see screenshot below
source to share
I have the same problem.
After some trying I found this solution
-
create only empty module named
java-dep-python
etc. then add it to project<module relativePaths="false" type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="true"> <orderEntry type="jdk" jdkName="Python 2.7" jdkType="Python SDK" /> <orderEntry type="sourceFolder" forTests="false" /> </component> </module>
-
change all your mixed modules to add a new empty module as a dependency
<module relativePaths="true" type="JAVA_MODULE" version="4"> <component name="FacetManager"> <facet type="Python" name="Python"> <configuration sdkName="Python 2.7" /> </facet> </component> <component name="NewModuleRootManager" inherit-compiler-output="true"> ... ... <orderEntry type="inheritedJdk" /> <orderEntry type="module" module-name="java-dep-python" scope="PROVIDED" /> ... ... </component> </module>
Please note that the keyword PROVIDED
helps so that this module is not required by any artifacts
This works for me, now that standard python imports are good.
IDEA 14.0.3 build # IU-139.1117
source to share
you must also install the SDK of the "Team" project; and install the project SDK in the python SDK you are going to use.
This might help too. multiple languages ββin one project in Intellij idea
source to share