I'm trying to read a pickle file.
df= pd.read_pickle(r'C:\\Users\\Downloads\\pickle_file')
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Downloads\\pickle_file'
I have no other instances of python running. It's my first time importing the pickle file. What causes this issue?
Related
When I try to run the Django server, the server runs properly, but I also get the following error and my developing website does not load properly. What could be the problem?
File "C:\Users\UserName\AppData\Local\Programs\Python\Python38-32\lib\wsgiref\handlers.py", line 183, in finish_response
for data in self.result:
File "C:\Users\UserName\AppData\Local\Programs\Python\Python38-32\lib\wsgiref\util.py", line 37, in __next__
data = self.filelike.read(self.blksize)
PermissionError: [Errno 13] Permission denied
There may be few reasons for that
Literally your account doesn't have proper permission to access it
Where the folder described doesn't exist
Where a folder is described instead of file
So I think you can find the reason if check above items
You can get the win32 handle of a file in Python by:
file = CreateFile("C:\\File.txt")
handle = str(msvcrt.get_osfhandle(file.fileno()))
file.close()
However to do this you need to make a file object, which cannot be a directory. For example,
dir = CreateFile("C:\\Directory")
handle = str(msvcrt.get_osfhandle(file.fileno()))
dir.close()
This throws an error because 'C:\Directory' is a directory:
PermissionError: [Errno 13] Permission denied: 'C:\\Directory'
See: PermissionError Errno 13 Permission denied
How could you do this or something like this for a directory?
I am using Google Colaboratory, and mounting Google Drive. When I try to copy a zip file with size 65Gb it gets me the following error:
[Errno 5] Input/output error
I used the below code to copy
%cp /content/drive/My\ Drive/###/data_odometry_gray.zip data_odometry_gray.zip
and also try this
import zipfile
zip_ref = zipfile.ZipFile("/content/drive/My Drive/###/data_odometry_gray.zip", 'r')
zip_ref.extractall("/content/")
zip_ref.close()
but same error
In my views I have:
import csv
outputfile = open("test.csv", 'w')
I am getting a [Errno 13] Permission Denied
So I tried just opening the file:
outputfile = open("test.csv")
I am getting a [Errno 2] No such file or directory: 'test.csv' when I try to open it.
When I run the same line of code using python manage.py shell, the file opens without an error. test.csv is in the same folder as my views.
Why am I getting these errors and how do I go about fixing them?
I am using IDLE on windows , when i run this below code i get error .
mut = 'F:\Perl\python\Examples'
file_name = open (mut,'r')
Traceback (most recent call last):
File "", line 1, in
file_name = open (mut,'r')
PermissionErroenter code herer: [Errno 13] Permission denied: 'F:\Perl\python\Examples'
'F:\Perl\python\Examples' is the path where my 'mut' file is located.
Please assists i am confused ?
'/' can be used on Windows quite happily, and is simpler.
Looks like Examples is a directory/folder - it should be a filename. That is why you are getting the error.
Note that open() returns a file handle, not a file name. What are you expecting this code to do?
Are you perhaps looking for os.walk() or os.listdir()?