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 in Python by Dinesh
39 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 by Omkar
• 66,050 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 in Python by Nymeria
• 3,500 points
207 views
0 votes
1 answer

Regarding pyc file in Python

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

answered Feb 7 in Python by Yogi
40 views
0 votes
1 answer

how to check for exceptions in a file?

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

answered Mar 20 in Python by Mohammad
• 1,400 points
8 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,580 points
56 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
27 views
+4 votes
6 answers
0 votes
1 answer

formatting_info=true for xlsx file handling

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

answered Mar 19 in Python by Omkar
• 66,050 points
26 views
+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
• 66,050 points
22 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.