How can I setup Jython in IntelliJ IDEA Community Edition 2017.2

已回答

I've installed the Python Community Edition plugin (python-ce-2017.2.172.3317.7.zip).  I've created a new Python project and python script file, but I can't figure out how to configure the project to run the script as Jython using the separately installed Jython 2.7.1.  I've tested the basic script below.

print "Hello World!"

However, I get the error below.

C:\Users\user\AppData\Local\Programs\Python\Python36-32\python.exe C:/Users/user/IdeaProjects/ucdJythonScripts/getWebSphereAutoStart.jy
File "C:/Users/user/IdeaProjects/ucdJythonScripts/getWebSphereAutoStart.jy", line 1
print "Hello World!"
^
SyntaxError: Missing parentheses in call to 'print'

Process finished with exit code 1

 

Thanks,

Brad

0

Add Jython SDK path as usual (like d:\dev\jython2.7.0\bin\jython.exe).





0
Avatar
Permanently deleted user

Thanks Serge!  When I try to add Jython as a Project SDK, I get the following error.  Am I missing something?

Brad

0

Run jython --version in the command line to ensure that your Jython installation works correctly.

0
Avatar
Permanently deleted user

Thanks, I should've thought of that!  That commands outputs the error below in case you have any idea what may be going on here.  I'm sure I followed the installation steps correctly so I'm not sure what is causing this issue.  I'm also looking on Google to see if I can find a root cause there.

Error loading Python DLL: C:\Users\u548679\apps\jython2.7.1\bin\python27.dll (error code 14001)

Regards,

Brad

0
Avatar
Permanently deleted user

I tried re-installing Jython 2.7.1, but that didn't help so I installed Jython 2.7.0 and I was able to get the expected version information from the version command line switch.  Unfortunately, even with 2.7.0, I still get the same error in IntelliJ.  Not sure if you still think I should try installing the Microsoft Visual C++ 2008 Redistributable Package, but unfortunately the corporate laptop I'm on is locked down from installing it.  Any other ideas?

Thanks again for all the help.

Brad

0
Avatar
Permanently deleted user

FYI... this same issue also occurs in PyCharm Community Edition 2017.1.5.  Not sure if both products share the same code base for adding Jython Project SDK,s.  If they do, it might be a bug in the code but if they don't it's probably more likely there is either some issue with either Jython 2.7.0 or my computer though if I can execute jython on the command line it seems that would indicate Jython is working correctly.

https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000457064/comments/115000385450

Brad

0

There seems to be some problem with Jython on your system. Or some security tool doesn't permit the IDE to start the external process. Please contact your corporate helpdesk to get it resolved.

0

I also do not manage to setup IBM websphere jython in the INtellij 2018.4 using Python v2018.3.183.5429.30 plugin.

On ubuntu using the IBM jdk8 from WAS

0

Please attach a screenshot showing the error and another one with your interpreter configuration when you try to create it.

Also, does it work from system terminal?

0

I'm also experiencing this problem, and after reading this thread, I don't know how to solve it.

I cannot select jython-standalone.jar (the executable).

1

请先登录再写评论。