BITPlan / diagrams

Online diagrams-Service supporting graphviz, mscgen and plantuml markup
http://diagrams2.bitplan.com
Apache License 2.0
2 stars 4 forks source link

Module dgs Not Found #6

Closed Jinlay closed 4 years ago

Jinlay commented 4 years ago

Trying to run python3 dgs/webserver.py or ./run in directory diagrams caused an error:

"File "dgs/webserver.py", line 9, in from dgs.diagrams import Generators, Generator, Example ModuleNotFoundError: No module named 'dgs'"<

Could be solved by chagngin line 9 in webserver.py from from dgs.diagrams import Generators, Generator, Example to from diagrams import Generators, Generator, Example

WolfgangFahl commented 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.

WolfgangFahl commented 4 years ago

Looks like the sudo command does not pick up the PYTHONPATH.