How to specify Python SDK
I recently upgraded to IntelliJ 8.1 - thank you, it's brilliant. I downloaded the Python plug-in because I'm going through Wesley J. Chun's "Core Python". The IDE looks to be as responsible for Python as it is for Java. The way the IDE "knows" the language and what I need is terrific.
However, I'm sorry to say that when I try to run my .py files I hit a brick wall. I haven't been successful at adding the Python SDK to the runtime configuration. The path to Python 2.6.1 is c:\Tools\Python-2.6.1. How do I tell IntelliJ where to look? Thanks.
Please sign in to leave a comment.
Hello Michael,
What's the problem exactly? You should create a Python module, and then you'll
be able to assign a Python SDK to it, and the Python run configuration will
work correctly.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi Dmitry,
I create a .py file, right click on it, select "Run", and then I get an error pop-up that says "Cannot run program c:\jdks\jdk1.6.0\python.exe in directory c:\tools\python-2.6.1 CreateProcess error=2, the system cannot find the file specified." I've obviously got a simple path issue, but I can't see where it needs to be set.
When I got to my Run configurations, I see a run configuration error that tells me the Python SDK needs to be specified. Where do I go to tell IntelliJ where to find python.exe?
Hello Michael,
Currently the .py file should be created in a Python module. We'll also add
a Python facet to allow working with Python files in Java modules.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Ah! Much better, but still not there. I created a new project and added a Python module. Now it's clear to see how I point to my python.exe.
My Python code is pretty simple, but when I try to run it I get this in the console window:
C:\Tools\Python-2.6.1\python.exe "C:/Documents and Settings/Michael/My Documents/Projects/Python/learning/recommendations/recommendations.py"
Process finished with exit code -1072365564
I can run that recommendations.py code in my IDLE IDE, so I believe it's syntactically correct. I must be missing something else fundamental.
Google didn't turn up anything on that exit code, so I'll have to keep looking. Thanks.
Anybody having any luck with the Python plug-in? I'm still not able to run in IntelliJ.
I have the path to python.exe in my PATH. If I open a command shell and type "python recommendations.py" it runs as it should.
I created a new project, added a Python module, set the SDK to point to my 2.6.1 Python home, but no joy.
What else could I have missed?
Attachment(s):
recommendations.py
My apologies. It's working now. I switched to Python 2.5, but I think the key thing was that I explicitly selected a Python SDK instead of the default. Now things are running fine. Thanks.