You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing packages during development, I mistakenly installed the fitz package instead of PyMuPDF. Initially, I didn't realize this mistake until I encountered some runtime errors. Afterward, I corrected this by installing PyMuPDF. However, after configuring all global variables, I encountered the following error:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
...
File "F:\a\b\c\lib\site-packages\starlette\staticfiles.py", line 56, in __init__
raise RuntimeError(f"Directory '{directory}' does not exist")
RuntimeError: Directory 'static/' does not exist
Allow me to hide some information about project path, Please.
These errors were extremely confusing because they originated from the package source code itself.
Solution
After searching online, I discovered the root cause of this issue on a Stack Overflow post. The issue was caused by the fitz package, which is incompatible with Python >= 3.8.
The solution is straightforward:
Uninstall the incorrect fitz package:
pip uninstall fitz
Install the correct PyMuPDF package:
pip install PyMuPDF
Proposed Enhancement
To prevent similar issues in the future, I suggest improving the installation process:
Use a file or similar mechanism to clearly specify the required packages for the project.
Just like a better requirements.txt or pyproject.toml
Provide documentation or comments to guide users to install the correct package versions.
This approach would help avoid confusion and prevent similar "false installations" from happening again.
Environment
OS: Windows 10
Python Version: 3.9.x
Relevant Packages:
Incorrect: fitz
Correct: PyMuPDF
Let me know if any additional details are required to address this issue. Thanks! 😊
The text was updated successfully, but these errors were encountered:
Description
When importing packages during development, I mistakenly installed the fitz package instead of PyMuPDF. Initially, I didn't realize this mistake until I encountered some runtime errors. Afterward, I corrected this by installing PyMuPDF. However, after configuring all global variables, I encountered the following error:
Allow me to hide some information about project path, Please.
These errors were extremely confusing because they originated from the package source code itself.
Solution
After searching online, I discovered the root cause of this issue on a Stack Overflow post. The issue was caused by the fitz package, which is incompatible with Python >= 3.8.
The solution is straightforward:
Uninstall the incorrect fitz package:
Install the correct PyMuPDF package:
Proposed Enhancement
To prevent similar issues in the future, I suggest improving the installation process:
requirements.txt
orpyproject.toml
This approach would help avoid confusion and prevent similar "false installations" from happening again.
Environment
Windows 10
3.9.x
fitz
PyMuPDF
Let me know if any additional details are required to address this issue. Thanks! 😊
The text was updated successfully, but these errors were encountered: