Hello,
I imported numpy and scipy library to calculate the points needed for function CSectionPolygon. This was working well in my Spyder(open source scientific environment written in Python). However when I run my script in TexGen, there was error'' ImportError: No module named numpy''. How can I figure this?
Thanks.
Zoe
Can't import numpy in Texgen
Moderators: Martin, Developers
Re: Can't import numpy in Texgen
Hi Zoe,
My guess is that this is a path issue. In Spyder it will be set up to know where to find the NumPy module. You probably need to add the folder which includes the NumPy module to your path so that it can be found from wherever you have TexGen installed.
Hope that helps,
Louise
My guess is that this is a path issue. In Spyder it will be set up to know where to find the NumPy module. You probably need to add the folder which includes the NumPy module to your path so that it can be found from wherever you have TexGen installed.
Hope that helps,
Louise
Re: Can't import numpy in Texgen
Hello,
After adding the path, there was a new problem.
It shows:
How can I figure this in texgen?
Thanks.
After adding the path, there was a new problem.
Code: Select all
import sys
sys.path.append('C:\\Users\\zoe\\Anaconda3\\Lib\\site-packages')Code: Select all
Traceback (most recent call last):
File "gui", line 1, in <module>
File "C:\Users\zoe\Desktop\temp.py", line 13, in <module>
import numpy as np
File "C:\Users\zoe\Anaconda3\Lib\site-packages\numpy\__init__.py", line 140, in <module>
from . import _distributor_init
File "C:\Users\zoe\Anaconda3\Lib\site-packages\numpy\_distributor_init.py", line 33, in <module>
with RTLD_for_MKL():
File "C:\Users\zoe\Anaconda3\Lib\site-packages\numpy\_distributor_init.py", line 18, in __enter__
import ctypes
ImportError: No module named ctypesThanks.
Re: Can't import numpy in Texgen
Hello,
I have figured this question by re-load a Texgen and python installation package rather than a python-bundled version,
Then I pip the numpy packages under the Python.
Thanks for your advice.
Zoe.
I have figured this question by re-load a Texgen and python installation package rather than a python-bundled version,
Then I pip the numpy packages under the Python.
Thanks for your advice.
Zoe.