ImportError: cannot import name 'get_host' from 'urllib3' (F:\coding\reptile\venv\lib\site-packages\urllib3\__init__.py)
时间: 2023-08-28 15:04:12 浏览: 1043
根据引用至的内容,"ImportError: cannot import name 'get_host' from 'urllib3'"错误通常发生在安装了不兼容的opencv-python和opencv-contrib-python版本时。解决此错误的方法是删除这两个库并重新安装opencv-python及与之相匹配的版本的opencv-contrib-python。具体操作步骤如下:
1. 在pycharm或服务器的终端中执行以下命令来卸载不兼容的opencv-python-headless版本:
```
pip uninstall opencv-python-headless
```
2. 接着,安装低于4.3版本的opencv-python-headless:
```
pip install "opencv-python-headless<4.3"
```
这样,重新安装并匹配版本的opencv-python和opencv-contrib-python之后,应该可以解决"ImportError: cannot import name 'get_host' from 'urllib3'"错误。请尝试以上方法,并在评论区反馈是否解决了问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [ImportError: cannot import name ‘_registerMatType‘ from ‘cv2.cv2‘解决方案](https://blog.csdn.net/qq_43010752/article/details/123350729)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文