New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import jpype module #189

Closed
sgess opened this Issue Oct 4, 2016 · 10 comments

Comments

Projects
None yet
4 participants
@sgess

sgess commented Oct 4, 2016

Environment:

$ python --version
Python 3.5.2 :: Anaconda 4.2.0 (64-bit)
$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

Error when I try to import:

In [1]: import jpype
Traceback (most recent call last):

File "", line 1, in
import jpype

File "/home/sgess/anaconda3/lib/python3.5/site-packages/JPype1-0.6.1-py3.5-linux-x86_64.egg/jpype/init.py", line 17, in
from ._jpackage import *

File "/home/sgess/anaconda3/lib/python3.5/site-packages/JPype1-0.6.1-py3.5-linux-x86_64.egg/jpype/_jpackage.py", line 18, in
import _jpype

ImportError: /home/sgess/anaconda3/lib/python3.5/site-packages/JPype1-0.6.1-py3.5-linux-x86_64.egg/_jpype.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE

@marscher

This comment has been minimized.

Show comment
Hide comment
@marscher

marscher Oct 4, 2016

Collaborator

looks like a problem with your c++ standard library? Did you install a binary version or from source?

Collaborator

marscher commented Oct 4, 2016

looks like a problem with your c++ standard library? Did you install a binary version or from source?

@sgess

This comment has been minimized.

Show comment
Hide comment
@sgess

sgess Oct 5, 2016

Hi Martin-

First, I tried with the version included in Anaconda. I am not sure if this is a binary or from source. Does Anaconda compile when it installs itself?

That didn’t work, so I removed the jpype package and followed the instructions here:

http://jpype.readthedocs.io/en/latest/install.html http://jpype.readthedocs.io/en/latest/install.html

and that also didn’t work.

Thanks for your quick response!

Best
Spencer

On Oct 5, 2016, at 1:47 AM, Martin K. Scherer notifications@github.com wrote:

looks like a problem with your c++ standard library? Did you install a binary version or from source?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #189 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ACEl4qKh1MQ0-Hcb9_SNZRz8zs4aGux_ks5qwuWmgaJpZM4KNuOj.

sgess commented Oct 5, 2016

Hi Martin-

First, I tried with the version included in Anaconda. I am not sure if this is a binary or from source. Does Anaconda compile when it installs itself?

That didn’t work, so I removed the jpype package and followed the instructions here:

http://jpype.readthedocs.io/en/latest/install.html http://jpype.readthedocs.io/en/latest/install.html

and that also didn’t work.

Thanks for your quick response!

Best
Spencer

On Oct 5, 2016, at 1:47 AM, Martin K. Scherer notifications@github.com wrote:

looks like a problem with your c++ standard library? Did you install a binary version or from source?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #189 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ACEl4qKh1MQ0-Hcb9_SNZRz8zs4aGux_ks5qwuWmgaJpZM4KNuOj.

@cstich

This comment has been minimized.

Show comment
Hide comment
@cstich

cstich Oct 12, 2016

I got the same error message as @sgess. As there seems to be some mix up with the GCC and anaconda I tried building an anaconda package. That also somewhat works, and I can now import jpype in python successfully, however I get the following error message when I try to import jpypex.

Program received signal SIGSEGV, Segmentation fault.
JPJavaEnv::GetEnv (this=0x0, env=0x7fffffff9880) at native/common/jp_javaenv.cpp:247
247 native/common/jp_javaenv.cpp: No such file or directory.

cstich commented Oct 12, 2016

I got the same error message as @sgess. As there seems to be some mix up with the GCC and anaconda I tried building an anaconda package. That also somewhat works, and I can now import jpype in python successfully, however I get the following error message when I try to import jpypex.

Program received signal SIGSEGV, Segmentation fault.
JPJavaEnv::GetEnv (this=0x0, env=0x7fffffff9880) at native/common/jp_javaenv.cpp:247
247 native/common/jp_javaenv.cpp: No such file or directory.
@marscher

This comment has been minimized.

Show comment
Hide comment
@marscher

marscher Oct 12, 2016

Collaborator

you can now install from conda-forge like this:

conda install -c conda-forge jypep1

We should update the documentation accordingly.

Collaborator

marscher commented Oct 12, 2016

you can now install from conda-forge like this:

conda install -c conda-forge jypep1

We should update the documentation accordingly.

@cstich

This comment has been minimized.

Show comment
Hide comment
@cstich

cstich Oct 12, 2016

Thanks. The package installs fine that way.
However, I still get the same seg fault though when I try to import jpypex. I don't know how relevant that is, but maybe you want to check that out.

cstich commented Oct 12, 2016

Thanks. The package installs fine that way.
However, I still get the same seg fault though when I try to import jpypex. I don't know how relevant that is, but maybe you want to check that out.

@marscher

This comment has been minimized.

Show comment
Hide comment
@marscher

marscher Oct 12, 2016

Collaborator
Collaborator

marscher commented Oct 12, 2016

@marscher

This comment has been minimized.

Show comment
Hide comment
@marscher

marscher Oct 12, 2016

Collaborator

@cstich it is used to access javax/swing. So you have to import jpype before and start a jvm to access it.

 python -c "import jpype; jpype.startJVM(jpype.get_default_jvm_path());import jpypex"

works fine

Collaborator

marscher commented Oct 12, 2016

@cstich it is used to access javax/swing. So you have to import jpype before and start a jvm to access it.

 python -c "import jpype; jpype.startJVM(jpype.get_default_jvm_path());import jpypex"

works fine

@marscher marscher closed this Oct 12, 2016

@marscher

This comment has been minimized.

Show comment
Hide comment
@marscher

marscher Oct 12, 2016

Collaborator

@sgess please stick to the pre-compiled version, I can not give support to set up sane development environments.

Collaborator

marscher commented Oct 12, 2016

@sgess please stick to the pre-compiled version, I can not give support to set up sane development environments.

@sgess

This comment has been minimized.

Show comment
Hide comment
@sgess

sgess Oct 13, 2016

I tried your solution and it works. Thanks!

On Oct 12, 2016, at 11:01 PM, Martin K. Scherer notifications@github.com wrote:

@sgess https://github.com/sgess please stick to the pre-compiled version, I can not give support to set up sane development environments.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #189 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ACEl4tkBdLNOVUpJEaYwp79kFZ2snpbMks5qzUqjgaJpZM4KNuOj.

sgess commented Oct 13, 2016

I tried your solution and it works. Thanks!

On Oct 12, 2016, at 11:01 PM, Martin K. Scherer notifications@github.com wrote:

@sgess https://github.com/sgess please stick to the pre-compiled version, I can not give support to set up sane development environments.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #189 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ACEl4tkBdLNOVUpJEaYwp79kFZ2snpbMks5qzUqjgaJpZM4KNuOj.

@beniroquai

This comment has been minimized.

Show comment
Hide comment
@beniroquai

beniroquai Dec 6, 2016

Great! It works! :)

beniroquai commented Dec 6, 2016

Great! It works! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment