Permission denied for pyc file

0 votes

I have written a Python script in a file and tried to run it yesterday. It ran properly without any errors. Today I am trying to run the same script again but I am getting error telling

Permission denied: .pyc

I did not get error log so posted only the main error. How to solve this?

Feb 7, 2019 in Python by Dinesh

1 answer to this question.

0 votes

Did you run the python script as the same user who created it? I am guessing it could be permission issue because you have created it as a different user and running it as a different user. There are 2 solutions for this:

  1. Switch to the user who created the script, and run it
  2. Change the permission of the file and run it. 

You can change the permission using the chmod command:

$ sudo chmod 777 /path/to/pyc/file
answered Feb 7, 2019 by Omkar
• 69,170 points

Related Questions In Python

0 votes
1 answer

Need help extracting a schema to make use for an avro file in Python

Hi, nice question. So what I daily use ...READ MORE

answered Jan 10, 2019 in Python by Nymeria
• 3,520 points
0 votes
1 answer

Regarding pyc file in Python

When you run a Python script, Python ...READ MORE

answered Feb 7, 2019 in Python by Yogi
0 votes
1 answer

how to check for exceptions in a file?

try { if (!file.exists("TextFile1.txt")) throw ...READ MORE

answered Mar 20, 2019 in Python by Mohammad
• 3,230 points
0 votes
1 answer

python code for fall detection of a video file

Hello @Aruna, You can refer this for your ...READ MORE

answered Dec 2, 2020 in Python by Niroj
• 82,820 points
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,365 views
0 votes
0 answers
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
0 votes
1 answer

formatting_info=true for xlsx file handling

There are 2 libraries used to handle ...READ MORE

answered Mar 19, 2019 in Python by Omkar
• 69,170 points
+1 vote
2 answers

Appending data to a file

First open the file that you want ...READ MORE

answered Jul 23, 2018 in Python by Omkar
• 69,170 points