Python module not importing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having trouble getting the numpy module to work with a python script I've been working on for Fusion 360. I looked around the forum and I didn't see any other posts with this particular problem. I even tried running a script that did nothing but try to import the module with no luck. I've gone so far as to completely uninstall python from my computer except for what comes in Fusion 360. I ran pip to install numpy into that python installation and then copied that numpy folder into my script folder.
I've setup my folder structure exactly as is shown in the help documentation linked below
Command:
from .Modules import numpy as np
Error Message:
>>> Traceback (most recent call last):
File "C:/Users/Eric/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/Test\Modules\__init__.py", line 126, in <module>
from numpy.__config__ import show as show_config
ImportError: No module named 'numpy'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Eric/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/Test/Test.py", line 1, in <module>
from .Modules import numpy as np
File "C:/Users/Eric/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/Test\Modules\__init__.py", line 131, in <module>
raise ImportError(msg)
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
>>>
I don't understand why I'm getting this error since the script is not located in the numpy directory.