pythonopenrefine

Cannot add python Requests module to OpenRefine


I can't seem to import the requests module into OpenRefine . How can I add more python modules to openrefine?

I get the error:

ImportError: No module named requests

screenshot

1


Solution

  • OpenRefine is using Jython, a Java implementation of Python. Therefore, you can not "just" install another library/package.

    There is a tutorial in the OpenRefine wiki describing how to extend Jython with PyPi modules.

    Please note that currently 2.7 is the newest Jython implementation. Jython 3 is still in it's planing and development phase. See Jython 3 Roadmap for details. This makes it difficult to use external libraries, as Python 2 had its end of life on 01.01.2020 and accordingly (most) libraries stopped supporting Python 2.

    For requests the last version that supports Python 2 is 2.27.

    Also, some Python packages rely on C libraries that are not compatible with Jython. Check the Appendix A of the Definitive Guide to Jython for more details on using external tools and libraries.