fusionIdea icon indicating copy to clipboard operation
fusionIdea copied to clipboard

PermissionError when executing

Open d-marquina opened this issue 3 years ago • 8 comments

Hi, as the title says, when I execute my code from PyCharm, a windows shows in Fusion with the next message after copying the Public key hash:

image

Just to be clear, the message says that I'm using PyCharm 2021.1.1, but I already upgraded it, the directory keeps its old name, though.

Should I reinstall PyCharm? I tried running it and Fusion360 as administrator but nothing happens.

Also, I don't know if it's related, but I have to disable the plugin support (on Languages & Frameworks) before closing the project, because, when I reopen it, an error closes the IDE.

My PyCharm version is 2022.2.3: image

And Fusion360 was updated last week: image

d-marquina avatar Nov 02 '22 16:11 d-marquina

Hmmm. I'm not really sure. Maybe something to do with the windows user having restricted permissions or something?

Does that path that's it's giving a permission denied on actually exist on your machine?

JesusFreke avatar Nov 08 '22 00:11 JesusFreke

I also initially thought about permissions, and tried to change them, but to no avail, that folder says "Read only". That path does exist, I also checked it. I even reinstalled PyCharm to a new location, but nothing happens.

d-marquina avatar Nov 11 '22 14:11 d-marquina

I just tried it with the same version of pycharm, and it's working fine for me. I'm also on the same version of windows, and fusion.

JesusFreke avatar Nov 11 '22 23:11 JesusFreke

Hi, I had the same issue, and debuged the add-in and the plugin to get to this conclusion: When you start the IDE, the "Run/Debug in Fusion 360" is disabled: image

To enable the "Run in Fusion 360" option you should run it first with any configuration. It will fail, but the "Run in Fusion 360" option will be available after that.

The problem is that it seems if you have run configuration set up, you had to fill it out properly even if you don't run that but you run. image You have to provide "script" in the configuration, otherwise the plugin will send the "jbr/bin" folder as script, which is not a file but a folder hence "Permission Denied" error is generated.

Set it up, to point your script file, and it will work.

spiralfuzet avatar Jan 30 '23 09:01 spiralfuzet

Interesting, thanks for digging into it. Were you using PyCharm as well? I'll see if I can reproduce and hopefully fix/improve this.

JesusFreke avatar Jan 30 '23 10:01 JesusFreke

Yes:

PyCharm 2022.3.2 (Community Edition)
Build #PC-223.8617.48, built on January 24, 2023
Runtime version: 17.0.5+1-b653.25 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 750M
Cores: 20
Non-Bundled Plugins:
    org.jf.fusionIdea (0.6.5)

spiralfuzet avatar Jan 30 '23 10:01 spiralfuzet

I confirm my problem was solved following your advice, thank you very much.

d-marquina avatar Jan 31 '23 19:01 d-marquina

I'm not able to reproduce the problem here. When I follow the steps at https://github.com/JesusFreke/fusionIdea/wiki/Getting-started-with-PyCharm-(Windows), the "Run in Fusion 360" and "Debug in Fusion 360" options in the editor context menu and in the run menu are enabled and work fine.

The only thing I can think of is that the plugin checks for either an adsk.core or adsk.fusion import, and the presence of a top level run() function, and doesn't show/enable the "Run/Debug in Fusion 360" options for that file if it doesn't find them.

JesusFreke avatar Mar 19 '23 05:03 JesusFreke