-
Notifications
You must be signed in to change notification settings - Fork 893
Pip build fails: FileNotFoundError: [Errno 2] No such file or directory: 'scripts/__init__.py' #571
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
Comments
Workaround is to use an older release:
|
This does not appear to work. I started with a fresh install of Buster Lite, ran The build still failed: `python -m pip install -v --no-binary=opencv-python-headless opencv-python-headless==4.5.3.56 Using pip 21.3 from /home/hesperosaurus/.pyenv/versions/3.10.0/lib/python3.10/site-packages/pip (python 3.10)
The device LEDs indicate that it is idle. Please advise. |
I determined the issue that caused my build to fail: The latest version of numpy is incompatible with Python 3.10.0. Link to numpy known issue. This is extraordinarily confusing because the precompiled binary for numpy, installable via pip, successfully installs in Python 3 - but the build process for opencv-python requires rebuilding numpy from source, and that process fails under 3.10.0. Installing Python 3.9.7, making that version global (via pyenv), and building opencv-python for Python 3.9.7 was successful. |
@elmeriniemela thank you for your feedback! At the moment, we hardly depends on files in opencv-python repository, especially on |
@neuron-whisperer the previous release (4.5.3.56) does not support Python 3.10. In your log python3.10 tries to install A line in your log:
I will remove the dependency on Currently, you can build the package from source using this repository. |
Will you end up pulling/removing https://pypi.org/project/opencv-python/4.5.4.58/? |
@asenyaev will this be fixed soon? |
In my case, upgrading to the last pip version fixed the problem:
|
Upgrading to the latest pip version didn't fix it for me, on 4.5.4.58 Python 3.9.1 via homebrew, pip 21.3.2, on macos 10.13.6. |
Same. My experiments followed the usual commands:
…etc. |
Failed on a Raspberry PI 4 with Debian buster Also the builds fails on piwheels: https://www.piwheels.org/project/opencv-python-headless/ Keeps the error
|
Same error for me :(
|
I am sorry for a long period of time with a silence, the PR should fix the problem. |
.... so that's why "pip3 install opencv-python" failed. FileNotFoundError: [Errno 2] No such file or directory: 'scripts/init.py' Too bad it takes hours of compiling before this error appears. From which version is this fixed? (Thanks :) ) OS: Raspbian 10 |
@bartgrefte as soon #577 is merged I guess. And for Pi look at: https://www.piwheels.org/project/opencv-python/ to see if there is a wheel version available. That will save the compilation time. And is a good indicator the build is correct and working. So we have to wait a bit more.... |
The piwheels version availability chart for this project looks like a minefield. |
If you have arm64 compatible OS on your Raspberry Pi then you should be able to run the arm64 wheels this project provides. If the latest release does not work, try one of the previous ones. |
I tried "pip3 install piwheels --extra-index-url https://www.piwheels.org/simple" , which resulted in: After which "pip3 install opencv-python" still wants to spend hours compiling wheels, am I missing something? |
Still failing after upgrading pip from 20.3.4 to 21.3.1
Edited: building wheel works with older version like mentioned in the first comment (tested: opencv-python-headless: 4.5.1.48) |
Is anyone still working on this? The piwheels build is still failing, https://www.piwheels.org/project/opencv-python/ |
#577 I believe it will be fixed in the next release. |
Faced this inside docker container on Nvidia Jetson nano, this fixed it for me too |
Installing the previous version succeeds using the following command:
|
Fixed in 4.5.4.60. Tested with Ubuntu 18.04 and command:
|
See opencv/opencv-python#571 for the related discussion. PiperOrigin-RevId: 411686231
See opencv/opencv-python#571 for the related discussion. PiperOrigin-RevId: 411686231
See opencv/opencv-python#571 for the related discussion. PiperOrigin-RevId: 411686231
See opencv/opencv-python#571 for the related discussion. PiperOrigin-RevId: 411728512
Ubuntu 22.04 LTS needs the same command as #571 (comment) |
@tfuto, what do you mean? Did you try to install By the way, I've tried to build |
@asenyaev I took a vanilla Ubuntu 22.04 LTS, upgraded everything (sudo apt update, sudo apt upgrade), then tried installing opencv-python, failed, arrived here, and comment #571 was the command that actually worked. A few days passed, and I worked on various things, but I can redo this quick drill to check again. |
@tfuto, if you tried to just install opencv-python, I guess it means that you use a latest version (4.6.0.66). However, I couldn't reproduce an issue with the latest version of opencv-python package on Ubuntu 22.04 LTS.
Even the build from source using the command
|
Reproduce:
pip install --upgrade pip setuptools wheel
CMAKE_ARGS="-DOPENCV_ENABLE_NONFREE=ON" pip install -v --no-binary=opencv-contrib-python opencv-contrib-python
Related commit: 6a1f61b#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R389
Related PR: #563
The text was updated successfully, but these errors were encountered: