Skip to content
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

Jep integration with scala spark #272

Closed
yunboouyang opened this issue Jul 16, 2020 · 4 comments
Closed

Jep integration with scala spark #272

yunboouyang opened this issue Jul 16, 2020 · 4 comments
Labels

Comments

@yunboouyang
Copy link

Is your feature request related to a problem? Please describe.
I'm trying jep 3.9.0 in spark scala and doing experiments on Yarn clusters. However I always got the following error

jep.JepException: <class 'ModuleNotFoundError'>: No module named 'jep'
	at <string>.<module>(<string>:1)
	at jep.Jep.eval(Native Method)
	at jep.Jep.eval(Jep.java:451)
	at jep.Jep.configureInterpreter(Jep.java:302)
	at jep.SharedInterpreter.configureInterpreter(SharedInterpreter.java:64)
	at jep.Jep.<init>(Jep.java:282)
	at jep.SharedInterpreter.<init>(SharedInterpreter.java:56)

This issue is related with #18, which indicates I need to set up PYTHONHOME environment variable so that I can find the virtual env directory. This is not easy in Spark. Could you provide some advice on how Jep integrates with Spark? Thank you!

@yunboouyang
Copy link
Author

yunboouyang commented Jul 16, 2020

I also tried using addIncludePaths to include jep package in sys.path in python and set config for SharedInterpreter. However, a new error occurs:

jep.JepException: <class 'ImportError'>: dynamic module does not define module export function (PyInit_jep)
	at <string>.<module>(<string>:1)
	at jep.Jep.eval(Native Method)
	at jep.Jep.eval(Jep.java:451)
	at jep.Jep.configureInterpreter(Jep.java:302)
	at jep.SharedInterpreter.configureInterpreter(SharedInterpreter.java:64)
	at jep.Jep.<init>(Jep.java:282)
	at jep.SharedInterpreter.<init>(SharedInterpreter.java:56)

@ndjensen ndjensen added the scala label Jul 20, 2020
@yunboouyang
Copy link
Author

Hi! I used objdump to print out the symbol table for jep.cpython-36m-x86_64-linux-gnu.so but cannot find anything related with PyInit_. Is this the reason that the function PyInit_jep cannot be found?

@bsteffensmeier
Copy link
Member

There is no PyInit_Jep in the .so because it is not loaded by python but instead is loaded by java/jni. The error probably means your python path is incorrect, it should point to the directory that contains the jep directory and not the jep directory itself. Python should load the jep module using the init.py in the jep directory, not using the .so.

@yunboouyang
Copy link
Author

Thanks! The cause is that I set python path to the jep directory. Close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants