How to call a script file? ModuleNotFoundError: No module...

More
7 years 54 minutes ago - 6 years 11 months ago #268 by Karatza
Hi,
i am trying to call after executing the python file

File Attachment:

File Name: fibo-main.py
File Size:0 KB

the file

File Attachment:

File Name: fibo.py
File Size:0 KB


In python3 works ($ python3 fibo-main.py
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
), is there any way to do something similar using ngsolve?
I see the error:

$ netgen fibo-main.py
...
importing NGSolve-6.2.1709-77-gef89d2d0
(should) load python file 'fibo-mai.py'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'fibo'
Finished executing fibo-main.py


best wishes
Makis
Last edit: 6 years 11 months ago by Karatza.
More
6 years 11 months ago #269 by cwinters
Hi,

you have to add the working directory (".") to the PYTHONPATH.
Using bash, this can be done as follows
Code:
export PYTHONPATH=$PYTHONPATH:.

Best,
Christoph
The following user(s) said Thank You: Karatza
Time to create page: 0.120 seconds