Search code examples
pythoneclipsejython

eclipse + jython: importError: No module named pycurl


I know this Error is known and there are a few solutions, but none worked for me.

I work with eclipse neon + jython 2.7 on a Mac. NO virtualenv.

I want to import pycurl, which is correctly installed!

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

The PythonPath in Eclipse is set to site-packages and pycurl and so on. i already tried every combination! I restarted eclipse every time after changing something at the paths.

I tried different installations:

sudo -H pip install pycurl
easy_install pycurl
pip -v install pycurl
pip -v install pycurl --upgrade

But if it is installed with one of these methods. it will always say that its already installed, when trying to install via another command. So I deinstalled and installed multiple times. I even tried it with the download of the pycurl website

So any suggestions, how to make this work?


Solution

  • I don't have much to do with pyCurl, but I try a guess.

    Is pyCurl implemented as a ".so"? If yes: It won't work, because Jython can't deal with it, because it's C-Stuff. Jython can only use pure Python or Java modules.

    In that case you have to look for an alternative in Java/Python or you need to find/create a wrapper and use JNI.

    If no: Did you add pyCurl in your project source folder the right way? Did you "import" in your code the right way?