Unable to run files that I have saved to my computer


#1

I recently downloaded Komodo in hopes of building my skills on Python 3. The video tutorial series I have been following recommended this platform as well. I am able to open and run the practice files that I downloaded for the video series, but I am unable to save new files under names that I have chosen.
For each execution of the code I saved, I receive the following error message:

env: /Users/myusername/Documents/Python Projects/helloworld.py: Permission Denied

with “Returned 126” at the bottom.

If there is anyway to fix this, then I would greatly appreciate the help.

I am currently using Komodo Edit version 11.1.0 on macosx
I am currently trying to use Python version 3.6.5


#2

You should first confirm that you have write permissions in that directory. It doesn’t look like you do.

Open a terminal, cd to your Documents directory and run ls -la. That will show you the permissions on Python Projects.

  • Carey

#3

Thanks for the quick response!

Unfortunately though, even after adjusting the permissions on the folder, I was still unable to run the files with Komodo. I received the same error message.


#4

@nopieps, i’m getting mixed information from you. In the first msg you said you could save a file, now you’re saying you can’t run a file.

Please explain what you are doing exactly, what you think it should do and what exactly it’s doing.

If you’re running files, share the files you are running, the commands you’re using to run them and how you’re running that command.

If you’re saving a file, share the exact steps you’re following to save the file.

  • Carey

#5

Sorry for the mixed messages.

For an example, I was given a folder with practice python codes from the online tutorial I was following. One of the practice codes is called “helloworld.py”. I am able to modify and run these python files, but ONLY if it save it in the same exercise folder and with the same name (i.e. “helloworld.py”).

My issue arises when I attempt to RUN python codes where I either saved the file to a different name or directory. One specific issue arose when I changed the name of “helloworld.py” to “helloworldedited.py”. When I try to run this file, the “Permission Denied” message returns. This also occurs if I were to save “helloworld.py” to a different folder from the original exercise folder. In my case, I tried to save “helloworld.py” to a folder called “Python Projects”, which is in a different directory, and run it to see if it would work. This process also gave me a return of “Permission Denied”.

My hope is that I can Save files to whatever name and directory I want, and be able to Run them in Komodo Edit without returning “Permission Denied”.

Again, sorry for the confusion, and I would be happy to make the situation more clear with images or videos if needed.

Thank you so much for your help.

@careyh


#6

@nopieps, thanks for clarifying. I can’t be sure what is causing your issue, other than it’s not (likely) Komodo. Try running the same code from the commandline, i’m 99% you’l have the same error. You’ll need to figure out what the permission issue is. That is an error coming from your OS, not Komodo.

Something to look for:

  • Are you starting Komodo from commandline as a different user?
  • did you add the files you’re working with as a different user (perhaps used SUDO)?
  • try creating a totally new file, not in whatever folder you downloaded and see if the issues continue.

#7

Hi there, I have the same problem as you had. Were you able to figure it out? I have not resolved this after trying the recommendations here.


#8

@alejo I have yet to figure out the issue.

Also, @careyh , I only have one user on my laptop, which is my personal one, so I shouldn’t be using SUDO, nor have I changed any settings that would cause me to run under “SUDO”. The file I have been trying to save my codes to is a new one I created myself, and I still received “Permission Denied”.


#9

This is true. It doesn’t mean you didn’t though :slight_smile: I can’t assume what you’ve done. I have to ask. The only reason you would get these errors if because you don’t have permission to write to the file or folder in question. Komodo doesn’t do anything special around that. It uses the permissions of the user that start the program.

See my 3rd point. Can you reproduce the issue with a new file? Also, does the same thing happen when you run the code in the command line?

@alejo and @nopieps, you need to figure out what permissions are set on your folders. I can assist to a certain extent but this isn’t a Komodo issue. Running ls -la in your project folder will show you the permissions set on your folder and files. If you downloaded a zipped or tarred folder, it is possible that permissions were already set on the files within that prevent you from writing to the files/folder. That’s an option when using some compression tools.

  • Carey

#10

I am also having this problem on installs on two different machines.

Komodo Edit, version 11.1.0, build 18196, platform macosx.
Built on Wed May 23 00:03:29 2018.

I can read files created by something else (like the Example files for a tutorial). If I save the files with a new name they appear in the directory I place them, but if I try to run them I get the “permission denied” error.
Digging in a bit I found the files are missing the executable permission. I can right click them in Komodo and select File Properties, click “Attributes”. The window pops up and has “Execute” unchecked. If I then check “Execute” and close out the windows I can then run the file.
Somewhere it seems when Komodo writes a new file it doesn’t give the Execute permission.

So for now I just do that right click on any new files created during my lesson.

Hope that clears up the description.


#11

Just did another test.
If I create a new file in IDLE “Hello made from IDLE.py” it can run from IDLE but not from Komodo.
If I do “ls -la” that file does not have the execute attribute (yet it runs from IDLE).

Weird


#12

I thought I had mentioned this before but apparently I didn’t. Check your umask setting. If that is configured incorrectly it would result in files being created that you can’t run.

I believe umask should be 022 and I believe you can set it using umask 022 but it might be different on Mac and you should figure out why it changed in the first place.

  • Carey

#13

[Unable to run files that I have saved to my computer]

This is the way to change the the permissions on the filed

Komodo IDE> right click on your file > file preferences > file properties> attributes Change... > and select all of them except for SUID, SGID, Sticky >> click ok > ok

You are good to go !!