From: yogita <re...@bu...> - 2019-12-18 13:27:34
|
New submission from yogita <yog...@gm...>: Hi Team, I want to import requests, json module in my java code . I have installed Jpython on unix & also installed requests module as well . My code is like : pythonInterp.exec("sys.path.append(\"/home/ec2-user/yogita/jpython/Lib/site-packages\")"); pythonInterp.exec("print (sys.path)"); pythonInterp.exec("import requests"); And output is like ['/home/ec2-user/yogita/jpython/Lib', '/home/ec2-user/yogita/jpython/Lib', '__classpath__', '__pyclasspath__/', '/home/ec2-user/yogita/jpython/Lib/site-packages', '/home/ec2-user/yogita/jpython/Lib/site-packages'] Exception while importing python module: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named requests /home/ec2-user/yogita/jpython/Lib/site-packages [ec2-user@ip-10-111-111-111 site-packages]$ ll total 80 drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 18 11:25 certifi drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 18 11:25 certifi-2019.11.28.dist-info drwxrwxr-x 3 ec2-user ec2-user 4096 Dec 18 11:25 chardet drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 18 11:25 chardet-3.0.4.dist-info -rw-rw-r-- 1 ec2-user ec2-user 126 Dec 18 08:59 easy_install.py -rw-rw-r-- 1 ec2-user ec2-user 2901 Dec 18 08:59 easy_install$py.class drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 18 11:25 idna drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 18 11:25 idna-2.8.dist-info drwxrwxr-x 10 ec2-user ec2-user 4096 Dec 18 08:59 pip drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 18 08:59 pip-9.0.1.dist-info drwxrwxr-x 4 ec2-user ec2-user 4096 Dec 18 08:59 pkg_resources -rw-rw-r-- 1 ec2-user ec2-user 119 Jun 30 2017 README drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 18 11:26 requests ---------- components: Library messages: 12854 milestone: Jython 2.7.1 nosy: Vikhe severity: urgent status: open title: Unable to import requests module in Jython versions: Jython 2.7.1 _______________________________________ Jython tracker <re...@bu...> <https://bugs.jython.org/issue2852> _______________________________________ |