Closed Jinlay closed 4 years ago
Thx for your issue report. I am sorry you ran into this problem and would like to comprehend how to avoid this situation in the future.
To reproduce the issue i did the following on an Ubuntu 18.04 LTS machine:
git clone https://github.com/BITPlan/diagrams
export PYTHONPATH=.
python3 dgs/webserver.py
which worked.
./run
which produced the error as outlined by you:
File "dgs/webserver.py", line 9, in <module>
from dgs.diagrams import Generators,Generator,Example
ModuleNotFoundError: No module named 'dgs'
although there are also commands to set the PYTHONPATH in the run script.
I'd rather fix the PYTHONPATH instead of changing the source code.
Looks like the sudo command does not pick up the PYTHONPATH.
Trying to run
python3 dgs/webserver.py
or./run
in directory diagrams caused an error:Could be solved by chagngin line 9 in webserver.py from
from dgs.diagrams import Generators, Generator, Example
tofrom diagrams import Generators, Generator, Example