wooey / Wooey

A Django app that creates automatic web UIs for Python scripts.
http://wooey.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.13k stars 184 forks source link

Error with relatives imports "ImportError: No module named " #263

Open puckk opened 6 years ago

puckk commented 6 years ago

I have a script that makes imports relative to the directory where it is (I have a file _ _init__.py in the directory lib/parser/). And when you add the script to Wooey it does not find it.

image

Chris7 commented 6 years ago

It is currently an open question how to handle these cases. Your script is uploaded to the wooey backend that then attempts to parse it. This is done in an area removed from where the script and thus relative imports are located. One idea to address this issue is found within #144 , and another implementation that would work currently is converting your script to a self-contained zip. There may be other solutions as well depending on how you are running the server (such as setting PYTHONPATH). I'm also open to other solutions.