網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
pip安裝opencv-python遇到的問(wèn)題
1.控制臺(tái)出現(xiàn)這種情況就是版本過(guò)低,需要先升級(jí)版本,命令pip install -upgrade pip
2. 出現(xiàn):Script file ‘D:\Python\Anaconda3\Scripts\pip-script.py’ is not present 原因就是升級(jí)pip過(guò)程中刪除了原對(duì)應(yīng)的文件 缺少升級(jí)后的pip及對(duì)應(yīng)目錄下的pip-script的python文件,缺少什么我們就加什么文件就解決問(wèn)題了。cd命令切換到Scripts文件,使用命令conda install pip
3. 重新用pip install opencv-python 使用pip list檢查安裝是否成功
樹(shù)莓派 pip安裝opencv-python的正確實(shí)踐
python -m pip install opencv-python -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
?
"""許多教程里的代碼都是用的老版本,函數(shù)API的接口有時(shí)不一樣,如果不指定版本的話會(huì)安裝最新版本,代碼得大#幅修改,給入門(mén)增加阻力。
#安裝指定版本: pip install opencv-python==3.4.3.18
記錄備查
"""
完整安裝過(guò)程如下
以后大家參考?
pi@raspberrypi:~ $ python -m pip install opencv-python -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/, https://www.piwheels.org/simple
Collecting opencv-python
Downloading http://pypi.doubanio.com/packages/a1/d6/8422797e35f8814b1d9842530566a949d9b5850a466321a6c1d5a99055ee/opencv-python-4.3.0.38.tar.gz (88.0MB)
100% |████████████████████████████████| 88.0MB 1.3MB/s
Installing build dependencies ... error
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'":
Ignoring numpy: markers 'python_version == "3.5"' don't match your environment
Ignoring numpy: markers 'python_version == "3.6"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7"' don't match your environment
Ignoring numpy: markers 'python_version >= "3.8"' don't match your environment
Looking in indexes: http://pypi.douban.com/simple/, https://www.piwheels.org/simple, https://www.piwheels.org/simple
Collecting setuptools
Downloading http://pypi.doubanio.com/packages/e1/b7/182161210a13158cd3ccc41ee19aadef54496b74f2817cc147006ec932b4/setuptools-44.1.1-py2.py3-none-any.whl (583kB)
Collecting wheel
Downloading http://pypi.doubanio.com/packages/a7/00/3df031b3ecd5444d572141321537080b40c1c25e1caa3d86cdd12e5e919c/wheel-0.35.1-py2.py3-none-any.whl
Collecting scikit-build
Downloading http://pypi.doubanio.com/packages/78/c9/7c2c7397ea64e36ebb292446896edcdecbb8c1aa6b9a1a32f6f67984c3df/scikit_build-0.11.1-py2.py3-none-any.whl (72kB)
Collecting cmake
Downloading http://pypi.doubanio.com/packages/eb/0a/039d5e4c4e2cf347091fe0e3ee322413e3750a5d4bd1d4b6d8537072687a/cmake-3.18.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-S8P7fC/cmake/setup.py", line 7, in <module>
from skbuild import setup
ImportError: No module named skbuild
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-S8P7fC/cmake/
----------------------------------------
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'"" failed with error code 1 in None
pi@raspberrypi:~ $ import cv2 as cv
bash: import:未找到命令
pi@raspberrypi:~ $ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2 as cv
>>> print(cv.__version__)
3.2.0
>>>
總結(jié)
原文鏈接:https://blog.csdn.net/weixin_53419152/article/details/126868809
- 上一篇:沒(méi)有了
- 下一篇:沒(méi)有了
相關(guān)推薦
- 2022-04-08 iOS實(shí)現(xiàn)計(jì)算器小功能_IOS
- 2022-04-28 Python模塊pexpect安裝及使用流程_python
- 2023-07-25 SpringBoot配置AOP
- 2022-04-08 pytorch?plt.savefig()的用法及保存路徑_python
- 2022-02-22 rcp異常org.eclipse.swt.SWTException: Invalid thread
- 2022-05-01 python?pandas庫(kù)讀取excel/csv中指定行或列數(shù)據(jù)_python
- 2023-02-12 react-router-domV6嵌套路由實(shí)現(xiàn)詳解_React
- 2022-03-24 C/C++實(shí)現(xiàn)蛇形矩陣的示例代碼_C 語(yǔ)言
- 欄目分類(lèi)
-
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過(guò)濾器
- Spring Security概述快速入門(mén)
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支