-
-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime error~import cv2 #326
Comments
Any update on this? getting same error on MacOs Monterey |
No update on this yet, I am still struggling to figure out what's wrong. |
This worked for me. Changing import in image_processing.py to:
|
I got this as well on MacOS 12 Monterey, Python 3.9, camelot 0.10.1. Looks like on the Mac at least there's a possibly related cv2 bug on MacOS 11 BigSur: opencv-python: opencv/opencv-python#777 I tried downgrading to opencv-python<3.7 in my requirements.txt file, and that seemed to solve the cv2 import issue, although I'm still working through other problems. |
I think this is a duplicate of #286 |
I still get an error: Is opencv a pip module or something like that? |
For The name of the package on PyPi and hence also for a pip command is The name of the module implemented by that package and required by Camelot is cv2. So And no need for any specific code in your project, because the Camelot library already includes the import statement The discussion above seems like it's some sort of version control issue in the python environment for @paulfruitful 's Linux environment and in a separate issue, in a Monterey MacOS environment for @euler007 and @YKdvd. So for @MartinMohammed just get I will see if I can unpick the Mac issue a little bit and comment again if I get anywhere - I do remember getting into dependency hell last time I was tinkering with this. |
I'm getting the same issue here on Windows 10 Pro with Python 3.12. I'll try some of the suggestions above. The camelot instructions at https://pypi.org/project/camelot-py/ do not mention installing opencv-python. Jinkies! Installing opencv-python-headless is 35MB. |
Describe the bug
Traceback (most recent call last):
File "/home/kali/Documents/PDF-Table-Exctractor/reader.py", line 1, in
import camelot
File "/usr/local/lib/python3.10/dist-packages/camelot/init.py", line 6, in
from .io import read_pdf
File "/usr/local/lib/python3.10/dist-packages/camelot/io.py", line 5, in
from .handlers import PDFHandler
File "/usr/local/lib/python3.10/dist-packages/camelot/handlers.py", line 9, in
from .parsers import Stream, Lattice
File "/usr/local/lib/python3.10/dist-packages/camelot/parsers/init.py", line 4, in
from .lattice import Lattice
File "/usr/local/lib/python3.10/dist-packages/camelot/parsers/lattice.py", line 26, in
from ..image_processing import (
File "/usr/local/lib/python3.10/dist-packages/camelot/image_processing.py", line 3, in
import cv2
ModuleNotFoundError: No module named 'cv2'
Steps to reproduce the bug
Expected behavior
Code
Environment
Additional context
The text was updated successfully, but these errors were encountered: