No module named 'adsk' problem - Python script for Autodesk Fusion 360

3.1k Views Asked by At

I want to draw 3D spheres using x,y,z coordinate. Then I am trying to use Python script for Autodesk Fusion 360(CAD). However, the error has occurred as the image. "No module named 'adsk' problem"

I tried to install the adsk module, but I cant intall. Then I found that the adsk is in definition folder. So I tried to run the file. But I cant get result.

enter image description here

1

There are 1 best solutions below

0
Araneus0390 On

1) As it described here it may be required to call from Tools Panel of Fusion.

2) Can you try to copy your adsk folder to C:\your_path_to_python_folder\Lib\site-packages\?

I think, in your case (based on screenshot, you published in post), just copy C:\Users\Wr\AppData\Roaming\Autodesk\Autodesk Fusion 360\API\Python\defs\adsk as C:\Python3.7\Lib\site-packages\adsk or C:\Users\Wr\AppData\Local\Programs\Python\Python37\Lib\site-packages\adsk

3) Otherwise, try to add as PYTHONPATH environment variable location of %AppData%\Roaming\Autodesk\Autodesk Fusion 360\API\Python or C:\Users\Wr\AppData\Roaming\Autodesk\Autodesk Fusion 360\API\Python

4) Otherwise: It may need to launch scripts from certain "environment" via terminal as is described here

In your case, probably:

cd "%AppData%\Roaming\Autodesk\Autodesk Fusion 360\API\Python"
# or
# cd "C:\Users\Wr\AppData\Roaming\Autodesk\Autodesk Fusion 360\API\Python"
.\python.exe "_here_is_address_to_your_script.py"

P.S. I can't comment, thus published as an answer.