Skip to content
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

I can not install the latest version (No ARM package for OpenCV in PyPI) #1063

Closed
1f7 opened this issue Nov 23, 2018 · 34 comments
Closed

I can not install the latest version (No ARM package for OpenCV in PyPI) #1063

1f7 opened this issue Nov 23, 2018 · 34 comments
Labels
ARM / Raspberry PI OS Linux release engineering how bCNC gets from developers to users (and back)

Comments

@1f7
Copy link

1f7 commented Nov 23, 2018

I try install to Ubuntu 16.04 according to the last instruction with no luck

orangepi@OrangePI:~$ pip2 install --upgrade bCNC  
Collecting bCNC  
  Using cached https://files.pythonhosted.org/packages/fe/b2/96469773dfba552ea45dcbf2cacc255d5d1d651f6cfe8b0a75beb082d2cc/bCNC-0.9.14.39.tar.gz  
Collecting pyserial<=3.0.1 (from bCNC)  
  Using cached https://files.pythonhosted.org/packages/42/68/41bab8a5e3e50705f25358f043181242fa197f313aa0476908d9852c8dc4/pyserial-3.0.1.tar.gz  
Collecting numpy>=1.15.4 (from bCNC)  
  Using cached https://files.pythonhosted.org/packages/2d/80/1809de155bad674b494248bcfca0e49eb4c5d8bee58f26fe7a0dd45029e2/numpy-1.15.4.zip  
Collecting opencv-python>=3.4.2.17 (from bCNC)  
  Could not find a version that satisfies the requirement opencv-python>=3.4.2.17 (from bCNC) (from versions: )  
No matching distribution found for opencv-python>=3.4.2.17 (from bCNC)  
You are using pip version 8.1.1, however version 18.1 is available.  
You should consider upgrading via the 'pip install --upgrade pip' command.

Previous versions were installed without problems.
opencv-python need compile by hand?

P.S.
git clone works fine, both @vlachoudis and @Harvie

@Harvie
Copy link
Collaborator

Harvie commented Nov 24, 2018

What CPU architecture is it?
Does sudo pip2 install opencv-python work? Which version does it install?
If not, does sudo apt-get install python-opencv install? Which version?

@Harvie Harvie added release engineering how bCNC gets from developers to users (and back) OS Linux ARM / Raspberry PI labels Nov 24, 2018
@Harvie Harvie added this to the 0.9.15 milestone Nov 24, 2018
@1f7
Copy link
Author

1f7 commented Nov 24, 2018

Orange Pi PC arm x32

uname -a
Linux OrangePI 3.4.39-01-lobo #1 SMP PREEMPT Sun Oct 25 14:46:41 CET 2015 armv7l armv7l armv7l GNU/Linux`

@1f7
Copy link
Author

1f7 commented Nov 24, 2018

Does sudo apt-get install python-opencv help?

 sudo apt-get install python-opencv
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-opencv is already the newest version (2.4.9.1+dfsg-1.5ubuntu1.1).
The following packages were automatically installed and are no longer required:
  libllvm3.8 libmircommon5
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Does sudo pip2 install opencv-python work?

 sudo pip2 install opencv-python
The directory '/home/orangepi/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/orangepi/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting opencv-python
  Could not find a version that satisfies the requirement opencv-python (from versions: )
No matching distribution found for opencv-python
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.


orangepi@OrangePI:~/Downloads$ pip2 install opencv-python
Collecting opencv-python
  Could not find a version that satisfies the requirement opencv-python (from versions: )
No matching distribution found for opencv-python
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Python 2.7.12

@Harvie
Copy link
Collaborator

Harvie commented Nov 24, 2018

From OpenCV project page: https://pypi.org/project/opencv-python/#description

Q: Pip fails with Could not find a version that satisfies the requirement ...?

A: Most likely the issue is related to too old pip and can be fixed by running pip install --upgrade pip. Note that the wheel (especially manylinux) format does not currently support properly ARM architecture so there are no packages for ARM based platforms in PyPI. However, opencv-python packages for Raspberry Pi can be found from https://www.piwheels.org/.

@Harvie Harvie changed the title I can not install the latest version I can not install the latest version (No ARM package for OpenCV in PyPI) Nov 24, 2018
@Harvie
Copy link
Collaborator

Harvie commented Nov 24, 2018

I've uploaded new version bCNC==0.9.14.41 to pypi, which should install with opencv version 2.4+
(I hope that will work with python-opencv installed using apt-get)
Try that pls.

@Harvie
Copy link
Collaborator

Harvie commented Nov 24, 2018

Otherwise you can install opencv manualy.
Here is the list of packages: https://www.piwheels.org/simple/opencv-python/
You have to select right one. I believe OrangePI is ARMv7.
You can install it directly like this:

pip2 install https://www.piwheels.org/simple/opencv-python/opencv_python-3.4.3.18-cp35-cp35m-linux_armv7l.whl#sha256=201422601fc99c89556c47538cb6f423f0cc1e974684701b9431bfa132fcac13

Harvie added a commit to Harvie/bCNC that referenced this issue Nov 24, 2018
@Harvie
Copy link
Collaborator

Harvie commented Nov 24, 2018

Please let me know how this turned out... Especialy what exactly solved the problem and if other packages installed well. I will add that to wiki.

@1f7
Copy link
Author

1f7 commented Nov 24, 2018

i delete cache and try also with error

orangepi@OrangePI:~$ pip2 install --upgrade bCNC
Collecting bCNC
  Downloading https://files.pythonhosted.org/packages/08/58/96d0d4781b863804a63cd1aca05a718c0245b15a8cf1e6a09d33b872c465/bCNC-0.9.14.41.tar.gz (1.1MB)
    100% |████████████████████████████████| 1.1MB 147kB/s
Collecting pyserial<=3.0.1 (from bCNC)
  Downloading https://files.pythonhosted.org/packages/42/68/41bab8a5e3e50705f25358f043181242fa197f313aa0476908d9852c8dc4/pyserial-3.0.1.tar.gz (134kB)
    100% |████████████████████████████████| 143kB 513kB/s
Collecting numpy>=1.15.4 (from bCNC)
  Downloading https://files.pythonhosted.org/packages/2d/80/1809de155bad674b494248bcfca0e49eb4c5d8bee58f26fe7a0dd45029e2/numpy-1.15.4.zip (4.5MB)
    100% |████████████████████████████████| 4.5MB 51kB/s
Collecting opencv-python>=2.4 (from bCNC)
  Could not find a version that satisfies the requirement opencv-python>=2.4 (from bCNC) (from versions: )
No matching distribution found for opencv-python>=2.4 (from bCNC)
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

second try

orangepi@OrangePI:~$ pip2 install https://www.piwheels.org/simple/opencv-python/opencv_python-3.4.3.18-cp35-cp35m-linux_armv7l.whl#sha256=201422601fc99c89556c47538cb6f423f0cc1e974684701b9431bfa132fcac13
opencv_python-3.4.3.18-cp35-cp35m-linux_armv7l.whl is not a supported wheel on this platform.
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

platform is Ubuntu 16.04

OrangePI is ARMv7

Yes x32

In first post i wrote - both version work fine with git cloned repo.
pip installer not work

@Harvie
Copy link
Collaborator

Harvie commented Nov 24, 2018

opencv_python-3.4.3.18-cp35-cp35m-linux_armv7l.whl is not a supported wheel on this platform.

Sorry, i've just found piwheels currently only support python 3.4 and 3.5, so it will not work with bCNC

In first post i wrote - both version work fine with git cloned repo.
pip installer not work

Yes, but that is because you have already installed some packages from previous installs of bCNC. I need this to work using pip install, otherwise there will be problem for new users who don't have these packages installed.

@1f7
Copy link
Author

1f7 commented Nov 24, 2018

Thank you @Harvie

snqiau c_cr

@Harvie Harvie removed this from the 0.9.15 milestone Nov 24, 2018
@Harvie
Copy link
Collaborator

Harvie commented Nov 24, 2018

I'll leave this open before i figure this out. It will probably take some time...

Guys working on this:
pypa/setuptools#1599
pypa/packaging-problems#214

@PannDemic
Copy link

So I am on a raspberry pi and I receive the same error, opencv-python>=2.4
I have python-opencv version 2.4.9.1 installed.
Sorry that I'm not the most knowledgeable about RPi or Raspbian. What information do you need to assist in trouble shooting?

@Harvie
Copy link
Collaborator

Harvie commented Dec 4, 2018

What information do you need to assist in trouble shooting?

I've referenced the pypa issues. This is not really problem of bCNC. It has to be solved in the pypi/pip.
But if they don't fix this by the time we will be releasing 0.9.15 (the first stable release of bCNC that will officialy support pip install) we can use the workaround.

For your convenience i've removed opencv from requirements, so pip install will work until they fix this.

@Harvie Harvie removed this from the 0.9.15 milestone Dec 14, 2018
@Harvie
Copy link
Collaborator

Harvie commented Dec 14, 2018

Since this is blocked by upstream, but workaround was applied, i've removed this from 0.9.15 milestone.
Now it should install on ARM, but webcam support is not installed by default (even on non-ARM systems).
Once pip will be able to handle soft-dependencies i will re-add opencv, so it will work on all platforms while installing opencv if available.

@ghost
Copy link

ghost commented Apr 16, 2019

Hellp my pleas

pip install upgrade
Collecting upgrade
Could not find a version that satisfies the requirement upgrade (from versions: )
No matching distrib

@Harvie
Copy link
Collaborator

Harvie commented Apr 16, 2019

@Mahmouderr404 please tell us more. What OS/distro? What python version?... please read wiki and README file.

@Harvie
Copy link
Collaborator

Harvie commented Jul 19, 2019

@1f7 @PannDemic Can you please check that everything works now on ARM?

In #1180 i've added condition, which should prevent opencv from being required on ARM, but i don't have raspi, so can't really check that...

@alien18331
Copy link

Hello
I have jetson nano(Cortex-A57 ARMv8-A 64-bit) with ubuntu 18.04.3 LTS
Can BCNC working on this? Thanks you

I install failed & get below massage

ERROR: Could not find a version that satisfies the requirement opencv-python>=2.4 (from bCNC) (from versions: none)
ERROR: No matching distribution found for opencv-python>=2.4 (from bCNC)

My installation flow is below

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git python python-tk python-pip
sudo apt-get install python-pip python-setuptools python-dev python-tk libjpeg-dev zlib1g zlib1g-dev
sudo pip install --upgrade pip
sudo apt-get install python-opencv   
sudo pip2 install --upgrade bCNC

--version

pip&pip3 : pip 19.2.3 from /home/smg/envs/TF2_ECP_EBR/lib/python3.6/site-packages/pip (python 3.6)
pip2 : pip 19.2.3 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

@Harvie
Copy link
Collaborator

Harvie commented Sep 24, 2019

@alien18331 setup.py defines following:
'opencv-python>=2.4 ; "arm" not in platform_machine'

which means opencv-python should not be installed on arm based systems at all, because it's not available at the moment. But your machine still tries to do so.

Can you please somehow extract platform_machine string from your python installation and send it to us?

you can get it with following code:

import platform
print(platform.machine())

@Harvie
Copy link
Collaborator

Harvie commented Sep 24, 2019

Can you please try pip2 install again? @ptvoinfo added "aarch64" exception to setup.py.
Otherwise i will still need your platform.machine() output...

@wabmester
Copy link

I'm having the same issue. Here's my platform: armv7l

@Harvie
Copy link
Collaborator

Harvie commented Oct 24, 2019

I'm having the same issue. Here's my platform: armv7l

But setup.py currently contains conditional "arm" not in platform_machine which should prevent opencv from installing, because armv7l contains string arm. Are you sure your platform.machine() string is really armv7l? and that you are installing latest version?

Otherwise there is some problem with setup.py and we need to figure it out...

@wabmester
Copy link

wabmester commented Oct 24, 2019

I don't know python or pip, but when I try to isolate that string from the setup script, it doesn't get evaluated as a conditional. I.e., the string ends up literally as 'opencv-python>=2.4 ; ("arm" not in platform_machine) and ("aarch64" not in platform_machine)'

I tried this in a couple different contexts, and got the same literal (using python 2.7.13)

@Harvie
Copy link
Collaborator

Harvie commented Oct 24, 2019

Can you please try pip install --upgrade pip ? the platform conditional is relatively new feature.

@wabmester
Copy link

wabmester commented Oct 24, 2019

"Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages "

(ran pip again just to be sure -- same error). Just out of curiosity, can you point me to the doc for that setup feature. I didn't see it when I looked for it.

Version info:
pip 19.3.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

Edit: work-around was to download, modify setup.py, and install from local copy.

@Harvie
Copy link
Collaborator

Harvie commented Dec 1, 2019

I don't know python or pip, but when I try to isolate that string from the setup script, it doesn't get evaluated as a conditional.

I think this is OK. the string should be evaluated by pip, not by setup.py.
Maybe the condition is not correctly formated, i don't know. But it seems to work most of the times... Any idea why your machine is different?

@wabmester
Copy link

I'll dig into it some more, but apparently the conditional dependency feature is a "minefield:"
https://hynek.me/articles/conditional-python-dependencies/

@Harvie
Copy link
Collaborator

Harvie commented Dec 2, 2019

@wabmester Can you please discuss this with setuptools guys?

https://github.com/pypa/setuptools/issues

Please show them our setup.py https://github.com/vlachoudis/bCNC/blob/master/setup.py
and describe how it still tries installing opencv on your machine even when disabled in setup.py

@quinkennedy
Copy link

@wabmester did you create an Issue on the setuptools github?

I have run into the same problem (opencv tries to install despite being in the exclusion list for "arm"):

  • Raspbian 9.11
  • Python 2.7
  • pip 20.0.2
  • setuptools 44.0.0

I thought maybe it had to do with my setuptools version (was v32) but after upgrading, the installer still doesn't work. I have seen that Python 2.7 is now deprecated: https://www.python.org/doc/sunset-python-2/

@quinkennedy
Copy link

In light of Py2 being deprecated, I decided to use py3

pip3 install --upgrade setuptools pip
pip3 install --upgrade bCNC
python3 -m bCNC

@Perlovka
Copy link

So, python-opencv is not an optional dependency, as stated in README?

Tried to install and got

pkg_resources.DistributionNotFound: The 'opencv-python>=2.4' distribution was not found and is required by bCNC

@quinkennedy
Copy link

@Perlovka it seems that the issue is that python-opencv is specified as an optional dependency, but setuptools for python 2.7 doesn't properly parse the dependecy list. AFAIK your options are:

  • manually edit the configuration to completely remove the python-opencv dependency
  • use python 3

@Perlovka
Copy link

@quinkennedy, python 3 requires python-opencv as well, so removing python-opencv from setup.py is the only option.

Even more - there is no python-opencv package in my system (gentoo just build opencv with python modules if you need them), so this will fail even if opencv is installed.

@bosd bosd mentioned this issue Nov 8, 2020
@bosd
Copy link
Contributor

bosd commented Nov 13, 2020

I think this one can be closed as well

@Harvie Harvie closed this as completed Nov 13, 2020
rar8000 pushed a commit to rar8000/bCNC that referenced this issue Jul 21, 2023
rar8000 pushed a commit to rar8000/bCNC that referenced this issue Jul 21, 2023
rar8000 pushed a commit to rar8000/bCNC that referenced this issue Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM / Raspberry PI OS Linux release engineering how bCNC gets from developers to users (and back)
Projects
None yet
Development

No branches or pull requests

8 participants