当前位置:网站首页>Cannot find reference 'imread' in 'appears in pycharm__ init__. py‘
Cannot find reference 'imread' in 'appears in pycharm__ init__. py‘
2022-06-24 22:00:00 【Jingwen · red spirit】
import cv2
import requests
from selenium import webdriver
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as Wait
driver = webdriver.Chrome() # establish Chrome object
# driver.get('https://www.baidu.com') # Visit Baidu .
driver.get("https://www.douban.com/")
driver.implicitly_wait(20)
driver.switch_to.frame(driver.find_element(By.XPATH,"//*[@id='anony-reg-new']/div/div[1]/iframe"))
driver.find_element(By.XPATH, "/html/body/div[1]/div[1]/ul[1]/li[2]").click()
driver.find_element(By.XPATH, "//*[@id='username']").send_keys("17600299304")
driver.find_element(By.XPATH, "//*[@id='password']").send_keys("17600299304")
driver.find_element(By.XPATH, "/html/body/div[1]/div[2]/div[1]/div[5]").click()
driver.switch_to.frame(driver.find_element(By.XPATH,'//*[@id="tcaptcha_iframe"]'))
# Big_img=driver.find_element(By.XPATH,'//*[@id="slideBg"]')
Big_img=driver.find_element(By.XPATH,'//*[@id="cdn1"]')
# //*[@id="cdn1"]
# Sim_img=driver.find_element(By.XPATH,'//*[@id="slideBlock"]')
Sim_img=driver.find_element(By.XPATH,'//*[@id="cdn2"]')
Big_url=Big_img.get_attribute('src')
Sim_url=Sim_img.get_attribute('src')
print(Big_url)
print(Sim_url)
# Download the slider and petal map to local
with open('11/Big_images.jpg', 'wb') as f:
f.write(requests.get(Big_url).content)
f.close()
with open('11/Sim_images.jpg', 'wb') as f:
f.write(requests.get(Sim_url).content)
f.close()
# AI matching slider verifies distance
cv2.imread()

https://blog.csdn.net/m0_60258123/article/details/121416424
https://blog.csdn.net/m0_60258123/article/details/121416424 In the article, through modification opencv Version of , It solves the problem perfectly , period warning, And the code prompt function can work normally .pip install -i https://pypi.douban.com/simple opencv-python==4.5.3.56,
But I have the following questions
C:\Users\euweb>pip install -i https://pypi.douban.com/simple opencv-python==4.5.3.56
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.douban.com/simple
Collecting opencv-python==4.5.3.56
Using cached https://pypi.doubanio.com/packages/01/9b/be08992293fb21faf35ab98e06924d7407fcfca89d89c5de65442631556a/opencv-python-4.5.3.56.tar.gz (89.2 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files\Python310\python.exe' 'C:\Users\euweb\AppData\Local\Temp\pip-standalone-pip-xzw6is2a\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix 'C:\Users\euweb\AppData\Local\Temp\pip-build-env-gtx9nthp\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.douban.com/simple -- setuptools wheel scikit-build cmake pip 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_machine != '"'"'aarch64'"'"' ahttps://blog.csdn.net/baidu88vip/article/details/89313548
https://blog.csdn.net/baidu88vip/article/details/89313548 Through the article pip install opencv-contrib-python Order to solve the problem , But the following problems occurred after my operation
C:\Users\euweb>pip install opencv-contrib-python
Defaulting to user installation because normal site-packages is not writeable
Collecting opencv-contrib-python
Downloading opencv_contrib_python-4.6.0.66-cp36-abi3-win_amd64.whl (42.5 MB)
|████████████████████████████████| 42.5 MB 352 kB/s
Collecting numpy>=1.17.3
Using cached numpy-1.22.4-cp310-cp310-win_amd64.whl (14.7 MB)
Installing collected packages: numpy, opencv-contrib-python
WARNING: The script f2py.exe is installed in 'C:\Users\euweb\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.22.4 opencv-contrib-python-4.6.0.66
WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available.
You should consider upgrading via the 'C:\Program Files\Python310\python.exe -m pip install --upgrade pip' command.
边栏推荐
- 拖动拖动拖动
- Visit Amazon memorydb and build your own redis memory database
- PyCharm 中出现Cannot find reference ‘imread‘ in ‘__init__.py‘
- 是真干不过00后,给我卷的崩溃,想离职了...
- Kubernetes 集群中流量暴露的几种方案
- CV2 package guide times could not find a version that satisfies the requirement CV2 (from versions: none)
- Redis+Caffeine两级缓存,让访问速度纵享丝滑
- 面试官:你说你精通Redis,你看过持久化的配置吗?
- leetcode_191_2021-10-15
- leetcode-201_ 2021_ 10_ seventeen
猜你喜欢

好想送对象一束花呀

Data link layer & some other protocols or technologies

滤波数据分析

【论】Deep learning in the COVID-19 epidemic: A deep model for urban traffic revitalization index

How to achieve energy conservation and environmental protection of full-color outdoor LED display

手动事务的几个类

架构实战营 第 6 期 毕业设计
![[theory] deep learning in the covid-19 epic: a deep model for urban traffic revitalization index](/img/d9/f5461a81a343f3c3ca01876e423fa2.png)
[theory] deep learning in the covid-19 epic: a deep model for urban traffic revitalization index

我国SaaS产业的发展趋势与路径

EasyBypass
随机推荐
How to achieve energy conservation and environmental protection of full-color outdoor LED display
Practice of hierarchical management based on kubesphere
机器学习:线性回归
Blender FAQs
Interviewer: you said you are proficient in redis. Have you seen the persistent configuration?
Transport layer UDP & TCP
leetcode_ 191_ 2021-10-15
【吴恩达笔记】机器学习基础
Byte software testing basin friends, you can change jobs. Is this still the byte you are thinking about?
平衡二叉搜索树
03---增反膜
Drag drag drag
Introduce the overall process of bootloader, PM, kernel and system startup
suspense组件和异步组件
Elegant custom ThreadPoolExecutor thread pool
Li Kou daily question - day 26 -496 Next larger element I
Graduation design of phase 6 of the construction practice camp
TKKC round#3
leetcode1863_2021-10-14
socket(2)