Python upgraded to 3.7.3 and Spyder replaced by VSCode (coming soon)

Python upgraded to 3.7.3 and Spyder replaced by VSCode (coming soon)

JeromeBriot
Mentor Mentor
5,232 Views
22 Replies
Message 1 of 23

Python upgraded to 3.7.3 and Spyder replaced by VSCode (coming soon)

JeromeBriot
Mentor
Mentor

Hello,

 

For those who don't read the Mod the Machine blog:

 - We are upgrading the Python version used in Fusion 360 to 3.7.3 in the September release.
 - We are also going to replace the editor from Spyder to VSCode in this release.

 

Full post here: New Python version and Visual Studio Code

 

The upgrade of Python was briefly mentionned 3 weeks ago by goyals in the Support forum (Update web browser coming with Fusion 360). But nothing yet about the replacement of Spyder by VSCode.

 

In my opinion, these information could have been posted in the API forum earlier.

 

By the way, thank you for these improvements.

 

 

5,233 Views
22 Replies
Replies (22)
Message 2 of 23

kandennti
Mentor
Mentor

The editor has been changed to VSCode, but an error occurs in debugging (F5).
Does anyone know how to set it up? launch.json? tasks.json?

 

Thank you in advance.

0 Likes
Message 3 of 23

BrianEkins
Mentor
Mentor

Are you on Windows or Mac?  The debugging process is different than it used to be but it is working for me on Windows but I'm having some problems debugging, and even just running, on Mac.  The documentation has been updated and contains the basic steps for debugging.  

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 4 of 23

kandennti
Mentor
Mentor

Thank you Brian.

 

When I checked the help, I couldn't see the online help.
I will check it later.

0 Likes
Message 5 of 23

PinRudolf
Advocate
Advocate

I'm really happy to start using VS Code! 😄

 

Thanks for the reference to the manual!

 

If I understand correctly the following will now be the method to start debugging: (Independent of the script already being opened or not)

  1. In fusion start Scripts And Add-Inns
  2. Select de script you want to debug (possibly switching a tab)
  3. Choose Debug
  4. Now switched to VS Code; start Debug again
  5. (F5 Again to continue)
  6. After completing your test; select Disconnect

Is there a method of connecting VS Code to Fusion more directly? Or can I restart de debugging faster?

 

The launch.json shows some properties which are not allowed?

0 Likes
Message 6 of 23

BrianEkins
Mentor
Mentor

You've got it.  Those are the current steps.  Maybe it's possible to improve some of the process but that's how it's now working.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 7 of 23

BrianEkins
Mentor
Mentor

A quick question to everyone that's started trying to use VS Code.  Are any of you using Mac?  I'm mostly on Windows but because I need to support apps on Mac I have one, but I've run into issues on my Mac and am wondering if they're general issues or specific to me.  Actually, the problems aren't limited to VS Code either.  Can you try running the "Spur Gear" script sample that comes with Fusion, not the add-in, and see if it works.  It's failing on my Mac.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 8 of 23

JeromeBriot
Mentor
Mentor

@BrianEkins, the "Spur Gear" script works on my Mac (Mac mini late 2012, macOS Mojave)

0 Likes
Message 9 of 23

JeromeBriot
Mentor
Mentor

It seems that the Custom Graphics sample doesn't work on my machines anymore (Windows and Mac).

 

 

0 Likes
Message 10 of 23

lorraine5RWGT
Enthusiast
Enthusiast

Do you know what happened to pip?

 

I was previously able to install other modules through pip, but pip doesn't even work any more in the most recent update: 

>>> pip.main(['install', 'numpy'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'pip' has no attribute 'main'

 

0 Likes
Message 11 of 23

lorraine5RWGT
Enthusiast
Enthusiast

Also, is it possible re-run a script in VS Code without having to go back to the Fusion window and clicking 'Debug' again?  Right now, nothing happens when try to run the script again in VSCode and it's a real time sink.

0 Likes
Message 12 of 23

lorraine5RWGT
Enthusiast
Enthusiast

Is it possible to revert back to an old version of Fusion temporarily?

0 Likes
Message 13 of 23

BrianEkins
Mentor
Mentor

The Custom Graphics sample wasn't working for me either.  I brought it up in VS Code and there were two problems listed.  The global statements for coordNumber and stripNumber were after those variables were used.  I moved them to the top of each of the functions and now it works.  Apparently the previous version of Python was more lenient.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 14 of 23

BrianEkins
Mentor
Mentor

A quick update about Mac.  I can no longer reproduce the problem and since no one else seems to be having it, it seems it was a weird, hopefully one time, issue isolated to my machine.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 15 of 23

BrianEkins
Mentor
Mentor

@lorraine5RWGT, it's not currently possible to start running a script from VS Code.  I also miss that capability from Spyder.  I would do a lot of prototyping of code as a script, even though it would eventually be used in an add-in just because it was an easier process.

 

However, we need to recognize this is the first release of Fusion 360 using VS Code and hopefully, some of the issues we're finding can be addressed in future updates.  I've been using VS Code for a few hours and the more I use it, the less I miss Spyder but there are still a couple of things I continue to miss.

 

It's also not possible to go back to an older version of Fusion 360.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 16 of 23

lorraine5RWGT
Enthusiast
Enthusiast

@BrianEkins Thank you!

0 Likes
Message 17 of 23

akonovalenko
Contributor
Contributor

I am getting Error when trying to attach to script in Fusion360 on Windows environment

Failed to attach (connect ECONNREFUSED 127.0.0.1:9000)

Should I add something special to launch.json or settings.json?

Fusion version 2.0.6503
VS code version 1.38.1 Screenshot_26.pngScreenshot_27.pngScreenshot_28.png

Message 18 of 23

goyals
Autodesk
Autodesk

In case you are trying to connect Fusion through VSCode directly then it is not possible at the moment. Please take a look at http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-743C88FB-CA3F-44B0-B0B9-FCC378D0D782 to know how to start debugging with VSCode. Thanks



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 19 of 23

Anonymous
Not applicable

Don't know if it will help but I was encountering the same issue.

What I was doing wrong was clicking on "EDIT"in the "Script & Add-in" window (like I was doing with Spyder)  while you need to click on "Debug" (hidden behind the "RUN" button) for debugging within VSC (see attached picture)

0 Likes
Message 20 of 23

rax2003_7
Participant
Participant
0 Likes