1

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

Stefan Becker
  • 5,695
  • 9
  • 20
  • 30
Woorim
  • 11
  • 1
  • 3
  • What errors did you get when you tried to install adsk? – Rob Streeting Oct 01 '19 at 08:42
  • 1
    @RobStreeting Second one in the image. – Woorim Oct 01 '19 at 09:33
  • I can't find that module on [pypi.org](https://pypi.org/search/?q=adsk), is the module on github? – Rob Streeting Oct 01 '19 at 09:41
  • @I think that its a function (third image). – Woorim Oct 01 '19 at 09:46
  • Aha ok, if you have the module installed already you need to add that directory to your PYTHONPATH environment variable. Follow the [instructions here](https://stackoverflow.com/a/4855685/1506086) to add PYTHONPATH to your environment variables, but also include the full path to the "defs" directory you screenshotted above. Then, reset your terminal and try again. – Rob Streeting Oct 01 '19 at 09:54
  • @Rob Steeting I have tried it, but its same as before. – Woorim Oct 01 '19 at 10:55

1 Answers1

2

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.

Araneus0390
  • 556
  • 1
  • 5
  • 18