question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PermissionError: [Errno 13] Permission denied

See original GitHub issue

When I run latexocr in Windows Terminal, I got this error:

Traceback (most recent call last):
  File "F:\Python\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "F:\Python\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "F:\Venv\pytorch_1.11\Scripts\latexocr.exe\__main__.py", line 7, in <module>
  File "F:\Venv\pytorch_1.11\lib\site-packages\pix2tex\gui.py", line 316, in main
    with in_model_path():
  File "F:\Python\lib\contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "F:\Venv\pytorch_1.11\lib\site-packages\pix2tex\utils\utils.py", line 161, in in_model_path
    with path('pix2tex', 'model') as model_path:
  File "F:\Python\lib\contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "F:\Python\lib\importlib\resources.py", line 175, in _path_from_reader
    opener_reader = reader.open_resource(norm_resource)
  File "<frozen importlib._bootstrap_external>", line 1055, in open_resource
PermissionError: [Errno 13] Permission denied: 'F:\\Venv\\pytorch_1.11\\lib\\site-packages\\pix2tex\\model'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
TITCcommented, Apr 18, 2022

Problem reproduced at python 3.9 env @hagayhillel @calmisential


(test) C:\Users\Yuhang>latexocr
Traceback (most recent call last):
  File "S:\Users\Yuhang\anaconda3\envs\test\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "S:\Users\Yuhang\anaconda3\envs\test\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "S:\Users\Yuhang\anaconda3\envs\test\Scripts\latexocr.exe\__main__.py", line 7, in <module>
  File "S:\Users\Yuhang\anaconda3\envs\test\lib\site-packages\pix2tex\gui.py", line 316, in main
    with in_model_path():
  File "S:\Users\Yuhang\anaconda3\envs\test\lib\contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "S:\Users\Yuhang\anaconda3\envs\test\lib\site-packages\pix2tex\utils\utils.py", line 161, in in_model_path
    with path('pix2tex', 'model') as model_path:
  File "S:\Users\Yuhang\anaconda3\envs\test\lib\contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "S:\Users\Yuhang\anaconda3\envs\test\lib\importlib\resources.py", line 175, in _path_from_reader
    opener_reader = reader.open_resource(norm_resource)
  File "<frozen importlib._bootstrap_external>", line 1055, in open_resource
PermissionError: [Errno 13] Permission denied: 'S:\\Users\\Yuhang\\anaconda3\\envs\\test\\lib\\site-packages\\pix2tex\\model'
1reaction
lukas-blechercommented, Apr 18, 2022

Solved in the newest version pip install -U pix2tex

Read more comments on GitHub >

github_iconTop Results From Across the Web

PermissionError: [Errno 13] Permission denied - Stack Overflow
This happens if you are trying to open a file, but your path is a folder. This can happen easily by mistake. To...
Read more >
Python PermissionError: [errno 13] permission denied Solution
The PermissionError: [errno 13] permission denied error occurs when you try to access a file from Python without having the necessary ...
Read more >
Fix - PermissionError: [Errno 13] Permission denied in Python
The python error “PermissionError: [Errno 13] Permission denied” can be fixed in various ways after knowing the root cause.
Read more >
PermissionError: [Errno 13] Permission denied error solved
The error "PermissionError: [Errno 13] Permission denied error" often occurs when the file you are trying to read from or write to is...
Read more >
PermissionError: [Errno 13] Permission denied: 'C:\\my\\path ...
You tried to move or replace a file which is open in another application. This is very common in PyInstaller if you open...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found