报错:
Collecting pip
Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6
514e675a1/pip-19.2.3-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Exception:
Traceback (most recent call last):
File "D:\PYTHON3.6\lib\shutil.py", line 544, in move
os.rename(src, real_dst)
OSError: [WinError 17] 系统无法将文件移到不同的磁盘驱动器。: 'h:\\gppython\\flask\\venv\\scripts\\pip.exe' -> 'C
:\\Users\\LiuWang\\AppData\\Local\\Temp\\pip-wqnotjid-uninstall\\gppython\\flask\\venv\\scripts\\pip.exe'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "h:\gppython\flask\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\basecommand.py", line 215, in main
File "h:\gppython\flask\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\commands\install.py", line 342, in run
File "h:\gppython\flask\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\req\req_set.py", line 778, in install
File "h:\gppython\flask\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\req\req_install.py", line 754, in unins
tall
File "h:\gppython\flask\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\req\req_uninstall.py", line 115, in rem
ove
File "h:\gppython\flask\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\utils\__init__.py", line 267, in rename
s
File "D:\PYTHON3.6\lib\shutil.py", line 559, in move
os.unlink(src)
PermissionError: [WinError 5] 拒绝访问。: 'h:\\gppython\\flask\\venv\\scripts\\pip.exe'
(venv) H:\GPpython\flask0918>pip list
Cannot open H:\GPpython\Flask\venv\Scripts\pip-script.py
(venv) H:\GPpython\flask0918>python -m pip install --upgrade pip
Requirement already up-to-date: pip in h:\gppython\flask\venv\lib\site-packages (19.2.3)
(venv) H:\GPpython\flask0918>pip list
Cannot open H:\GPpython\Flask\venv\Scripts\pip-script.py
(venv) H:\GPpython\flask0918>python -m pip install --upgrade pip ^L^L
ERROR: Invalid requirement: ''
(venv) H:\GPpython\flask0918>pip list
Cannot open H:\GPpython\Flask\venv\Scripts\pip-script.py
(venv) H:\GPpython\flask0918>easy_install pip
Searching for pip
Best match: pip 19.2.3
Adding pip 19.2.3 to easy-install.pth file
Installing pip-script.py script to H:\GPpython\Flask\venv\Scripts
Installing pip.exe script to H:\GPpython\Flask\venv\Scripts
Installing pip3-script.py script to H:\GPpython\Flask\venv\Scripts
Installing pip3.exe script to H:\GPpython\Flask\venv\Scripts
Installing pip3.7-script.py script to H:\GPpython\Flask\venv\Scripts
Installing pip3.7.exe script to H:\GPpython\Flask\venv\Scripts
Using h:\gppython\flask\venv\lib\site-packages
Processing dependencies for pip
Finished processing dependencies for pip
(venv) H:\GPpython\flask0918>pip list
Package Version
---------------- -------
Click 7.0
Flask 1.1.1
Flask-SQLAlchemy 2.4.0
itsdangerous 1.1.0
Jinja2 2.10.1
MarkupSafe 1.1.1
mysql-connector 2.2.9
pip 19.2.3
PyMySQL 0.9.3
setuptools 28.8.0
SQLAlchemy 1.3.8
Werkzeug 0.15.6
解决:
安装Pyhton版openCV时,首先要更新pip版本,运行:
报错:
python -m pip install --upgrade pip
这个问题还是pip安装的问题,所以可以在命令行窗口(或者win+r) 输入:
easy_install pip