Public bug reported:

This worked find in 18.04, but in 19.04, when trying to "import foo"
inside a multicorn module, if "foo" has been installed by pip under
/usr/local/lib/python3.x/foo, multicorn fails to find it and gives an
error like this in the Postgres log file:

2019-04-23 14:12:25.450 BST [15899] postgres@foo ERROR:  Error in python: 
ModuleNotFoundError
2019-04-23 14:12:25.450 BST [15899] postgres@foo DETAIL:  Traceback (most 
recent call last):

          File "/usr/lib/python3/dist-packages/multicorn/__init__.py", line 
543, in get_class
            module = import_module(module_name)

          File "/usr/lib/python3/dist-packages/multicorn/__init__.py", line 
523, in import_module
            __import__(name)

          File "/usr/lib/python3/dist-packages/paiyroll_fdw/__init__.py", line 
32, in <module>
            from dateutil.parser import isoparse

        ModuleNotFoundError: No module named 'dateutil'

Upon further investigation, it seems that the module load path (i.e.
"sys.path") does not look where pip does its installations; the value of
sys.path is at the point where the exception is thrown is:

path=['/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6
/lib-dynload', '/usr/lib/python3/dist-packages']

and clearly does not include /usr/local/lib/python3.x.

** Affects: postgresql-multicorn (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1825989

Title:
  Multicorn cannot find Python module installed using pip

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postgresql-multicorn/+bug/1825989/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to