Ask Your Question

How can I use external libraries from a Python processor?

asked 2017-09-12 10:46:33 -0600

jeff gravatar image

updated 2017-09-12 15:42:01 -0600

metadaddy gravatar image

I have a Python script that uses the pandas module. When I try to import it into my script, I get this error: No module named pandas. How can I configure the Jython script processor to use external libraries?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-09-12 15:41:43 -0600

metadaddy gravatar image

updated 2017-09-20 13:08:56 -0600

LC gravatar image

You can use external Python modules with SDC's Jython script evaluator as long as they don't include any Python extensions written in C. Append the Python package location to sys.path; for example, to import requests:

import sys
# Set to wherever the requests package lives on your machine
import requests

The problem with pandas and other Python packages such as NumPy is that, even if you import the Python modules, you will not be able to use them, since they include C extensions, which cannot be loaded by Jython. There are initiatives such as JyNI that aim to bridge the gap between Jython and C extensions; SDC-7313 tracks inclusion of JyNI with the SDC Jython Evaluator.

edit flag offensive delete link more


How to install other python packages? I want to install dateutil.

kranthi gravatar imagekranthi ( 2018-07-17 18:50:16 -0600 )edit

Please ask a new question, @kranthi - this comment won't be easily seen

metadaddy gravatar imagemetadaddy ( 2018-07-17 19:33:52 -0600 )edit

Sure. thanks, I just figured out the way..

kranthi gravatar imagekranthi ( 2018-07-17 20:37:48 -0600 )edit

i follwed above steps still i am getting ImportError: No module named requests

niranjan gravatar imageniranjan ( 2020-01-07 08:41:04 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-12 10:46:33 -0600

Seen: 3,659 times

Last updated: Sep 20 '17