Open JeLuF opened 1 year ago
There are a few possible reasons why you might be encountering this PermissionError when trying to write to a file using the tqdm library:
The file you are trying to write to might be located in a protected system directory, in which case you may need to run the script as an administrator to have sufficient permissions.
The file you are trying to write to might be in use by another program or process. If another program has the file open and locked, you will not be able to write to it until it is released.
If you are trying to write to a file on a network drive, make sure that the network connection is stable and that you have the necessary permissions to access the file.
There might be an issue with the colorama library, which is used by tqdm to display progress bars in the terminal. You could try upgrading to the latest version of colorama to see if this resolves the issue.
My understanding is that colorama is a library to enable color support in the Windows cmd
terminal emulator. tqdm is a library to draw a progress bar. The 'file' that tqdm is writing the progress bar to is stdout, which writes to the terminal, so I think we can rule out options 1 to 3 as they only apply to files in a filesystem.
As stated above, the colorama version in use is 0.4.6, which seems to be the latest version available.
Some research on the Internet revealed a few reports where users encountered this error when using Unicode codepages like 65001. The user who reported this bug to us is using codepage 437.
We have a few users that are encountering the above error:
Python is started from a
cmd
window. The colorama version is 0.4.6 on Windows 10. The script is run as normal user.Do you have any idea why this might happen?