- Thank you received: 0
How to call a script file? ModuleNotFoundError: No module...
7 years 54 minutes ago - 6 years 11 months ago #268
by Karatza
Hi,
i am trying to call after executing the python file
the file
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
i am trying to call after executing the python file
the file
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
Attachments:
Last edit: 6 years 11 months ago by Karatza.
6 years 11 months ago #269
by cwinters
Replied by cwinters on topic How to call a script file? ModuleNotFoundError: No module...
Hi,
you have to add the working directory (".") to the PYTHONPATH.
Using bash, this can be done as follows
Best,
Christoph
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