Comments (7)
@skvark This didn't work. My wheel contained an empty cv2 package, with an empty __init.py__
.
I solved this issue by moving to docker from cloud foundry and building everything from source. It seems to be working now.
Thanks for the advice!
from opencv-python.
The current build setup in this repository uses special CentOS 5 Docker containers. Installing latest FFmpeg on them might be a bit complicated.
I'm not familiar with Cloud Foundry, but I think that the easiest way for your use case is to build OpenCV manually and copy the OpenCV binary to your Trusty environment.
from opencv-python.
@skvark I did try to build OpenCV manually, and the python bindings for it using anaconda. It failed everytime.
I have a deb python-opencv which works perfectly on my local machine, but cloud foundry doesn't allow installation of deb files or anything using apt-get
for that matter. I'm trying to figure out a way to make my custom buildpack, but in the meantime, is there any way in which I could package an already compiled and working cv2.so
and cv.py
files extracted from that deb so that I can install it using pip?
from opencv-python.
How the OpenCV was compiled? If I understand you correctly, it depends on FFmpeg, and it means that the FFmpeg binaries must be also in the Trusty machine. If they are not there/can't be installed there, you have to first copy all the precompiled binaries to the cv2
folder along with the OpenCV binary or binaries.
After that clean the setup.py
script and then run python setup.py bdist_wheel
. All the other files/folders in this repo are irrelevant in your case. I'm not sure if this works. If you end up packaging the FFmpeg binaries to the same package, cv2/__init__.py
might need some additional logic to add the binary folder path to LD_LIBRARY_PATH (I'm just guessing, I have never tried this).
from opencv-python.
There is no setup.py
file. The .deb
file has the precompiled cv2.so
file.
As far as my compilation of OpenCV is concerned, I do have FFmpeg binaries and all the dependencies installed.
Just to re iterate the query I have right now, given that I have the .so
file needed by python, it there a way to make a package install-able by pip?
from opencv-python.
Sorry, I wasn't clear enough. My previous post was a guide how to adapt the files in this repo to construct a a wheel package to be installed with pip. So, in short:
- Take the setup.py file and cv2 folder from this repo
- Follow the instructions in my previous comment
- You will end up with a wheel package. This package must be installed manually:
pip install wheel_package_name.whl
from opencv-python.
Gotcha. I'll try this and get back to you.
from opencv-python.
Related Issues (20)
- PyPI: macOS arm64 wheel missing
- cv2.createThinPlateSplineShapeTransformer not exist in 4.10
- imdecode jpeg2000 segfault or deadlock in multithreading HOT 2
- Typing of compare does not allow scalar for src1 or src2
- Why Building wheel for opencv-python when using "pip install opencv-python"
- Typing stubs generation has failed when building wheel HOT 1
- error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\layers\convolution_layer.cpp:396: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 4 in function 'cv::dnn::ConvolutionLayerImpl::getMemoryShapes'
- Gstreamer support on windows 10
- why ı am getting this error
- BUG: cv2.fillPoly() causing segmentation fault on Ubuntu 22.04.4 LTS HOT 1
- [Suggestion] Metapackage as solution to current issues with opencv as dependency HOT 1
- Build from source python 3.12 fails HOT 6
- error: OpenCV(4.8.0) /io/opencv/modules/core/src/copy.cpp:71: error: (-215:Assertion failed) cn <= 4 in function 'scalarToRawData'
- ModuleNotFoundError: No module named 'distutils' in latest release HOT 7
- MacOS arm64 wheels missing from PyPI 4.10 release HOT 2
- ImportError: numpy.core.multiarray --- Numpy 2.0.0 HOT 1
- cv2/cv2.abi3.so, 2): Library not loaded: /usr/local/opt/libunistring/lib/libunistring.2.dylib Referenced from: /usr/local/opt/gnutls/lib/libgnutls.30.dylib HOT 1
- When will opencv-python support numpy 2.0? HOT 6
- compile bug
- AttributeError: module 'numpy' has no attribute 'object'. `np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencv-python.