{"id":154,"date":"2024-03-07T08:56:40","date_gmt":"2024-03-07T00:56:40","guid":{"rendered":"https:\/\/lhtnet.com\/?p=154"},"modified":"2024-03-07T08:56:40","modified_gmt":"2024-03-07T00:56:40","slug":"%e6%a0%91%e8%8e%93%e6%b4%be-pip%e5%ae%89%e8%a3%85opencv-python%e7%9a%84%e6%ad%a3%e7%a1%ae%e5%ae%9e%e8%b7%b5","status":"publish","type":"post","link":"https:\/\/lhtnet.com\/index.php\/2024\/03\/07\/%e6%a0%91%e8%8e%93%e6%b4%be-pip%e5%ae%89%e8%a3%85opencv-python%e7%9a%84%e6%ad%a3%e7%a1%ae%e5%ae%9e%e8%b7%b5\/","title":{"rendered":"\u6811\u8393\u6d3e pip\u5b89\u88c5opencv-python\u7684\u6b63\u786e\u5b9e\u8df5"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\u200b\npython -m pip install opencv-python -i http:\/\/pypi.douban.com\/simple\/ --trusted-host pypi.douban.com\n\n\"\"\"\u8bb8\u591a\u6559\u7a0b\u91cc\u7684\u4ee3\u7801\u90fd\u662f\u7528\u7684\u8001\u7248\u672c\uff0c\u51fd\u6570API\u7684\u63a5\u53e3\u6709\u65f6\u4e0d\u4e00\u6837\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\u7248\u672c\u7684\u8bdd\u4f1a\u5b89\u88c5\u6700\u65b0\u7248\u672c\uff0c\u4ee3\u7801\u5f97\u5927#\u5e45\u4fee\u6539\uff0c\u7ed9\u5165\u95e8\u589e\u52a0\u963b\u529b\u3002\n#\u5b89\u88c5\u6307\u5b9a\u7248\u672c\uff1a pip install opencv-python==3.4.3.18\n\u8bb0\u5f55\u5907\u67e5\n\"\"\"\n\n\u200b\n<\/code><\/pre>\n\n\n\n<p>\u5b8c\u6574\u5b89\u88c5\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>\u4ee5\u540e\u5927\u5bb6\u53c2\u8003&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u200b\npi@raspberrypi:~ $ python -m pip install opencv-python -i http:\/\/pypi.douban.com\/simple\/ --trusted-host pypi.douban.com\nLooking in indexes: http:\/\/pypi.douban.com\/simple\/, https:\/\/www.piwheels.org\/simple\nCollecting opencv-python\n  Downloading http:\/\/pypi.doubanio.com\/packages\/a1\/d6\/8422797e35f8814b1d9842530566a949d9b5850a466321a6c1d5a99055ee\/opencv-python-4.3.0.38.tar.gz (88.0MB)\n    100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 88.0MB 1.3MB\/s \n  Installing build dependencies ... error\n  Complete output from command \/usr\/bin\/python -m pip install --ignore-installed --no-user --prefix \/tmp\/pip-build-env-L6WFRh --no-warn-script-location --no-binary :none: --only-binary :none: -i http:\/\/pypi.douban.com\/simple\/ --extra-index-url https:\/\/www.piwheels.org\/simple --trusted-host pypi.douban.com -- setuptools wheel scikit-build cmake pip \"numpy==1.11.3; python_version=='3.5'\" \"numpy==1.13.3; python_version=='3.6'\" \"numpy==1.14.5; python_version=='3.7'\" \"numpy==1.17.3; python_version>='3.8'\":\n  Ignoring numpy: markers 'python_version == \"3.5\"' don't match your environment\n  Ignoring numpy: markers 'python_version == \"3.6\"' don't match your environment\n  Ignoring numpy: markers 'python_version == \"3.7\"' don't match your environment\n  Ignoring numpy: markers 'python_version >= \"3.8\"' don't match your environment\n  Looking in indexes: http:\/\/pypi.douban.com\/simple\/, https:\/\/www.piwheels.org\/simple, https:\/\/www.piwheels.org\/simple\n  Collecting setuptools\n    Downloading http:\/\/pypi.doubanio.com\/packages\/e1\/b7\/182161210a13158cd3ccc41ee19aadef54496b74f2817cc147006ec932b4\/setuptools-44.1.1-py2.py3-none-any.whl (583kB)\n  Collecting wheel\n    Downloading http:\/\/pypi.doubanio.com\/packages\/a7\/00\/3df031b3ecd5444d572141321537080b40c1c25e1caa3d86cdd12e5e919c\/wheel-0.35.1-py2.py3-none-any.whl\n  Collecting scikit-build\n    Downloading http:\/\/pypi.doubanio.com\/packages\/78\/c9\/7c2c7397ea64e36ebb292446896edcdecbb8c1aa6b9a1a32f6f67984c3df\/scikit_build-0.11.1-py2.py3-none-any.whl (72kB)\n  Collecting cmake\n    Downloading http:\/\/pypi.doubanio.com\/packages\/eb\/0a\/039d5e4c4e2cf347091fe0e3ee322413e3750a5d4bd1d4b6d8537072687a\/cmake-3.18.2.post1.tar.gz\n      Complete output from command python setup.py egg_info:\n      Traceback (most recent call last):\n        File \"&lt;string>\", line 1, in &lt;module>\n        File \"\/tmp\/pip-install-S8P7fC\/cmake\/setup.py\", line 7, in &lt;module>\n          from skbuild import setup\n      ImportError: No module named skbuild\n  \n      ----------------------------------------\n  Command \"python setup.py egg_info\" failed with error code 1 in \/tmp\/pip-install-S8P7fC\/cmake\/\n  \n  ----------------------------------------\nCommand \"\/usr\/bin\/python -m pip install --ignore-installed --no-user --prefix \/tmp\/pip-build-env-L6WFRh --no-warn-script-location --no-binary :none: --only-binary :none: -i http:\/\/pypi.douban.com\/simple\/ --extra-index-url https:\/\/www.piwheels.org\/simple --trusted-host pypi.douban.com -- setuptools wheel scikit-build cmake pip \"numpy==1.11.3; python_version=='3.5'\" \"numpy==1.13.3; python_version=='3.6'\" \"numpy==1.14.5; python_version=='3.7'\" \"numpy==1.17.3; python_version>='3.8'\"\" failed with error code 1 in None\npi@raspberrypi:~ $ import cv2 as cv\nbash: import\uff1a\u672a\u627e\u5230\u547d\u4ee4\npi@raspberrypi:~ $ python\nPython 2.7.16 (default, Oct 10 2019, 22:02:15) \n&#91;GCC 8.3.0] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import cv2 as cv\n>>> print(cv.__version__)\n3.2.0\n>>> \n\n\u200b<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b8c\u6574\u5b89\u88c5\u8fc7\u7a0b\u5982\u4e0b\uff1a \u4ee5\u540e\u5927\u5bb6\u53c2\u8003&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/comments?post=154"}],"version-history":[{"count":1,"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":155,"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/posts\/154\/revisions\/155"}],"wp:attachment":[{"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/media?parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lhtnet.com\/index.php\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}