无法使用Pipenv和Python 3.8安装OpenCV-Python

我刚刚在Mac OS X(10.15.1)上安装了Python 3.8,并试图将opencv-python添加到我的pipenv项目中。我做了以下事情:

$> pipenv install opencv-python
Installing dependencies from Pipfile.lock (ec16ad)…
An error occurred while installing opencv-python==4.1.1.26 --hash=sha256:01505b131dc35f60e99a5da98b77156e37f872ae0ff5596e5e68d526bb572d3c --hash=sha256:0478a1037505ddde312806c960a5e8958d2cf7a2885e8f2f5dde74c4028e0b04 --hash=sha256:17810b89f9ef8e8537e75332acf533e619e26ccadbf1b73f24bf338f2d327ddd --hash=sha256:19ad2ea9fb32946761b47b9d6eed51876a8329da127f27788263fecd66651ba0 --hash=sha256:1a250edb739baf3e7c25d99a2ee252aac4f59a97e0bee39237eaa490fd0281d3 --hash=sha256:3505468970448f66cd776cb9e179570c87988f94b5cf9bcbc4c2d88bd88bbdf1 --hash=sha256:4e04a91da157885359f487534433340b2d709927559c80acf62c28167e59be02 --hash=sha256:5a49cffcdec5e37217672579c3343565926d999642844efa9c6a031ed5f32318 --hash=sha256:604b2ce3d4a86480ced0813da7fba269b4605ad9fea26cd2144d8077928d4b49 --hash=sha256:61cbb8fa9565a0480c46028599431ad8f19181a7fac8070a700515fd54cd7377 --hash=sha256:62d7c6e511c9454f099616315c695d02a584048e1affe034b39160db7a2ae34d --hash=sha256:6555272dd9efd412d17cdc1a4f4c2da5753c099d95d9ff01aca54bb9782fb5cf --hash=sha256:67d994c6b2b14cb9239e85dc7dfa6c08ef7cf6eb4def80c0af6141dfacc8cbb9 --hash=sha256:68c9cbe538666c4667523821cc56caee49389bea06bae4c0fc2cd68bd264226a --hash=sha256:822ad8f628a9498f569c57d30865f5ef9ee17824cee0a1d456211f742028c135 --hash=sha256:82d972429eb4fee22c1dc4204af2a2e981f010e5e4f66daea2a6c68381b79184 --hash=sha256:9128924f5b58269ee221b8cf2d736f31bd3bb0391b92ee8504caadd68c8176a2 --hash=sha256:9172cf8270572c494d8b2ae12ef87c0f6eed9d132927e614099f76843b0c91d7 --hash=sha256:952bce4d30a8287b17721ddaad7f115dab268efee8576249ddfede80ec2ce404 --hash=sha256:a8147718e70b1f170a3d26518e992160137365a4db0ed82a9efd3040f9f660d4 --hash=sha256:bfdb636a3796ff223460ea0fcfda906b3b54f4bef22ae433a5b67e66fab00b25 --hash=sha256:c9c3f27867153634e1083390920067008ebaaab78aeb09c4e0274e69746cb2c8 --hash=sha256:d69be21973d450a4662ae6bd1b3df6b1af030e448d7276380b0d1adf7c8c2ae6 --hash=sha256:db1479636812a6579a3753b72a6fefaa73190f32bf7b19e483f8bc750cebe1a5 --hash=sha256:db8313d755962a7dd61e5c22a651e0743208adfdb255c6ec8904ce9cb02940c6 --hash=sha256:e4625a6b032e7797958aeb630d6e3e91e3896d285020aae612e6d7b342d6dfea --hash=sha256:e8397a26966a1290836a52c34b362aabc65a422b9ffabcbbdec1862f023ccab8! Will try again.
  ?   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 2/2 — 00:00:00
Installing initially failed dependencies…
[pipenv.exceptions.InstallError]:   File "/Users/stevenbarnett/library/Python/3.8/lib/python/site-packages/pipenv/core.py",line 1863,in do_install
[pipenv.exceptions.InstallError]:       do_init(
[pipenv.exceptions.InstallError]:   File "/Users/stevenbarnett/library/Python/3.8/lib/python/site-packages/pipenv/core.py",line 1246,in do_init
[pipenv.exceptions.InstallError]:       do_install_dependencies(
[pipenv.exceptions.InstallError]:   File "/Users/stevenbarnett/library/Python/3.8/lib/python/site-packages/pipenv/core.py",line 858,in do_install_dependencies
[pipenv.exceptions.InstallError]:       batch_install(
[pipenv.exceptions.InstallError]:   File "/Users/stevenbarnett/library/Python/3.8/lib/python/site-packages/pipenv/core.py",line 763,in batch_install
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs,not blocking,failed_deps_queue,retry=retry)
[pipenv.exceptions.InstallError]:   File "/Users/stevenbarnett/library/Python/3.8/lib/python/site-packages/pipenv/core.py",line 681,in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise exceptions.InstallError(c.dep.name,extra=err_lines)
[pipenv.exceptions.InstallError]: []
[pipenv.exceptions.InstallError]: ['ERROR: Could not find a version that satisfies the requirement opencv-python==4.1.1.26 (from -r /var/folders/17/82l5td8d01nbgslcj1lbfh8r0000gn/T/pipenv-glzkfmcm-requirements/pipenv-a34e3whg-requirement.txt (line 1)) (from versions: none)','ERROR: No matching distribution found for opencv-python==4.1.1.26 (from -r /var/folders/17/82l5td8d01nbgslcj1lbfh8r0000gn/T/pipenv-glzkfmcm-requirements/pipenv-a34e3whg-requirement.txt (line 1))']
ERROR: ERROR: Package installation failed...
  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/1 — 00:00:00
$>

我在做什么错?我以为pipenv应该可以防止所有这些依赖错误...

jianghuic705 回答:无法使用Pipenv和Python 3.8安装OpenCV-Python

正如@eyllanesc所提到的,请尝试为较低版本的python安装opencv-python,例如。 python 3.7

原因仍然是适用于opencv-python的python 3.8软件包,如以下网址所示。

https://pypi.org/project/opencv-python/#files

本文链接:https://www.f2er.com/3141479.html

大家都在问