regarding configuring jython with intellij idea python plugin

Debabrata Pani <[email protected]>
Newsgroups gmane.comp.lang.jython.user
Message-ID <CAKJw4fd98p5S=jTrFXpT5pM6Pjk+Qi6WnQGLmNLjanBKiyMkZA@mail.gmail.com>
I switched to IntelliJ IDEA at workplace (team reasons)

And evaluated the intellij python plugin with jython 2.7.0 on my MAC OS X
10.9.5

I download the jython installer and went through the installation procedure
before using the python plugin of IntelliJ IDEA

In IntelliJ IDEA we have to setup a python SDK which can be used for
executing python scripts which I did promptly by pointing towards the
jython executable file.
While trying to run a python script (of reasonable complexity with lots of
java and python modules dependencies ) , *I got the following error* :

Exception in thread “main” ImportError: Cannot import site module and its
dependencies: No module named site
Determine if the following attributes are correct:

   - sys.path: [‘/opt/jython2.7.0/Lib1’, ‘/opt/python-dateutil-1.5’,
   ‘/Users/someuser/.m2/repository/org/apache/hive/shims/hive-shims-common/0.13.0/hive-shims-common-0.13.0.jar’,
   * elided a lot of jars * , ‘/opt/jython2.7.0/Lib’, ‘*classpath*‘, ‘
   *pyclasspath*/‘]
   This attribute might be including the wrong directories, such as from
   CPython
   - sys.prefix: /opt/jython2.7.0
   This attribute is set by the system property python.home, although it can
   be often automatically determined by the location of the Jython jar file

You can use the -S option or python.import.site=false to not import the
site module
On using -S switch, I got more frustrating errors

Traceback (most recent call last):
File
“/Users/debabratapani/mobileum/work/code/datamodel/oozie/DomesticAverage/ProcessDomesticAverageAction.py”,
line 6, in
import oozie.common.dataset as dataset
File
“/Users/debabratapani/mobileum/work/code/datamodel/oozie/common/dataset.py”,
line 4, in
import re
*ImportError: No module named re*

*How is -S causing this ? *
Removed the -S switch and add the following environment variable

JYTHONPATH=/opt/jython270/Lib

*It went through fine*
I don’t need to add this environment variable when i use the jython
executable itself.

*Suggestion why this is required?*

After this configuration headache, using IntelliJ IDEA with python plugin
is breeze.
​

------------------------------------------------------------------------------

_______________________________________________
Jython-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.