Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python editing and debugging does not work

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
jaegeraxel
2949 Views, 8 Replies

Python editing and debugging does not work

Hello,

yesterday I ran the update to Fusion 360 Ultimate and got the new python scripting capabilities. However, I was not so sucessfull using them because I ran into some problems:

- When trying to edit a script using the script-dialog, nothing happens

- When trying to debug a script, nothing happens

- When trying to run, a script runs as long as there is no errors in it. If there are errors on the script, nothing happens as well, no error dialog happens.

Manually editing the files and run them using the scripts-dialog works as long as there are no errors in the script.

 

I read that there should be some python IDE spyder embedded in fusion360, obviously this component does not run correctly in my installation. 

 

Any clues how to debug this?

 

I run fusion360 on windows 8.1

 

8 REPLIES 8
Message 2 of 9
renyongfu
in reply to: jaegeraxel

Hello,

 

I can lauch Spyder on my Windows 8.1 without problem.

 

Can you try the following steps to see the problem can be fixed?:

1. delete the folder with name .spyder2-py3 under the user folder, in my case, it is C:\Users\Yongfu\.spyder2-py3

 

 spyder0.png

 

 

2. show the text command window:

spyder1.png

 

3. Launch Spyder from  the text command window by typing python.ide

spyder2.png

 

 

If you have two monitors,  please check if spyder window is shown on a different monitor.

 

Please let me know if you can launch spyder with the above steps.

 

Yongfu

 

Tags (1)
Message 3 of 9
jaegeraxel
in reply to: renyongfu

Hi,

thanks for your reply. I solved it myself. Here's what I had:

- I had a second installation of python and got that in my PATH as well as a PYTHONPATH set to the second python installation. After removing the second python installation from the environment variables, spyder works.

 

Maybe it is a good idea to issue a warning if a PYTHONPATH is set. However, I think it will be hard to figure out when something bad is in PATH.

 

Best regards,

Axel

Message 4 of 9
whunter
in reply to: jaegeraxel

Hi all;

 

I have the same issue after installing Python(x,y)...

Spyder launches via Fusion's GUI, but doesn't get past the "Setting up main window..." splash screen below, then disappears.

 

2014-12-08 21_41_14-Clipboard.png

 

My environment variables look OK to me, no double entries, so the above solution doesn't work for me. I can however launch Fusion's Spyder via the Text Command window...

 

I can also launch Spyder that shipped with Python(x,y).

 

I deleted the .spyder2-py3 directory that Fusion put there, then tried editing scripts again via F360, still gets stuck at "Setting up main window..." splash screen, then disappears. Deleted all the .spyder2 directories, tried again, no luck. Also restarted Fusion, no change.

 

My platform: Win 8.1, 64-bit. User account without admin privlages (I have a separate Admin account).

 

Please help!

 

R,

William

 

 

Message 5 of 9
Anonymous
in reply to: whunter

 

Hello, William,

 

I can reproduce the problem by installing Python(x,y). At least in my test, the issue was caused by addtional paths added to the enviroment varible PATH. I could resolve the issue by removing C:\Python27\Scripts in the PATH enviroment varible setting. "C:\Python27\Scripts" contains another set of Spyder scripts that cause the startup failure. Please see the screen dump below on How to update PATH enviroment varible.

 

Please let me know if the above temporarily solution works.

 

At the same time, we are seeking a better solution for resolving conflicting issues. It is a very nice suggestion for allowing alternative editors. We will put it on our radar in future releases.

 

Regards,

 

Yongfu Ren

 

RemovePythonScriptPath.png

Message 6 of 9
whunter
in reply to: Anonymous

Hello Yongfu;

 

Removing C:\Python27\Scripts from the Path env variable worked for me, thanks. I don't know if it will break things on Python(x,y)'s side, I may only discsover that at a later stage, but for now it's OK.

 

I'll check whether specifying your own IDE for Python is in the IdeaStation, else I'll add it.

 

Regards,

William

Message 7 of 9
Anonymous
in reply to: whunter

I am facing similar issues with Debugging using Spyder.

- It hangs quite a few time

- As suggested above, deleted the ".spyder2-py3" folder and then went to invoke "python.ide", but the Text Command window was disabled (gray), could not type in anything.

- Started with usual New->Scripts way, could set break points, but current line was not visible some times. Stepping to Next line did not work

- If you are at some line, and by that time some geometry is created, you can not see that on the Canvas. Only after executing whole program, I could see something.

 

I don't know whats going on. Is it just my setup thats gone bad. For me, scritpting and debugging is just not working (frustrating really).

Message 8 of 9
ekinsb
in reply to: Anonymous

There has been a fix for Python debugging that's in the update coming out later this month.  Please try that and let us know if you're still seeing problems.

 

Regarding not seeing geometry displayed on the canvas, that's to be expected with Python.  Python is running within Fusion's process and the main Fusin thread is dedicated to handling the running Python script.  The geometry is being created but the display isn't getting a chance to update.  If you want to see the geometry as it's being drawn you can add a call to the doEvents function to give the rest of Fusion to catch up.  To call doEvents you use adsk.doEvents().


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 9 of 9
Anonymous
in reply to: ekinsb

Thanks for the info. Looking forward to the update later this month

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report