From: Stefan R. <Ste...@gm...> - 2018-02-12 19:05:47
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>AFAIK matplotlib contains some C-extension code. This is currently not supported in Jython, JyNI is the way to go here.</div> <div>However, JyNI cannot load matplotlib as of this writing, but might support it in a future release.</div> <div>So maybe nothing is wrong with your paths, Jython just does not know what to do with a native library.</div> <div> </div> <div>-Stefan</div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Montag, 12. Februar 2018 um 17:42 Uhr<br/> <b>Von:</b> "Jeff Mitchell" <jef...@za...><br/> <b>An:</b> "Parastoo Delgoshaei" <p.d...@gm...><br/> <b>Cc:</b> jyt...@li...<br/> <b>Betreff:</b> Re: [Jython-users] Modules are not found when importing Python in Jython</div> <div name="quoted-content"> <div>If you're running inside a WAR or EAR, it can be tricky to know what module path to include in your sys.path .. at least, I find it so. (ie: Storing modules in Web-content, and exploded paths by a container, etc) <div> </div> <div>I tend to have a config file that I pull in as part of bootstrapping, which appends various path to sys.path or the CLASSPATH. </div> <div> </div> <div>Perhaps try printing our your paths, and making sure the pu modules and .jar dependencies are in there, or adding some paths.</div> <div> </div> <div>jeff</div> </div> <div class="gmail_extra"> <div class="gmail_quote">On Mon, Feb 12, 2018 at 11:34 AM, Parastoo Delgoshaei <span><<a href="mailto:p.d...@gm..." onclick="parent.window.location.href='p.d...@gm...'; return false;" target="_blank">p.d...@gm...</a>></span> wrote: <blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;"> <div>Greetings, <div> </div> <div>I am trying to use a Python class in my Jython code. The Python code works fine by itself and is using some modules such as matplotlib. However, when I attempt to import it in my Jython code, I get the error:</div> <div> </div> <div> </div> <div>'<span style="color: rgb(0,0,0);font-family: Menlo;font-size: 11.0px;">No module named matplotlib'.</span></div> <div> </div> <div> </div> <div>I, also, have added the path to Python site-packages to my classpath and still did not see the issue resolved.</div> <div> </div> <div>Thank you</div> <div> </div> <div> </div> </div> <br/> ------------------------------------------------------------------------------<br/> Check out the vibrant tech community on one of the world's most<br/> engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot" target="_blank">http://sdm.link/slashdot</a><br/> _______________________________________________<br/> Jython-users mailing list<br/> <a href="mailto:Jyt...@li..." onclick="parent.window.location.href='Jyt...@li...'; return false;" target="_blank">Jyt...@li...</a><br/> <a href="https://lists.sourceforge.net/lists/listinfo/jython-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/jython-users</a><br/> </blockquote> </div> </div> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot_______________________________________________" target="_blank">http://sdm.link/slashdot_______________________________________________</a> Jython-users mailing list Jyt...@li... <a href="https://lists.sourceforge.net/lists/listinfo/jython-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/jython-users</a></div> </div> </div> </div></div></body></html> |