python3.7 安装mysql
python安装报错
pip不是内部或者外部命令
1、将D:\Python\Python38\Scripts配置到环境变量
2、或者直接到该目录下进行测试
错误
C:\Users\Administrator> pip install pymysql
Collecting pymysql
Downloading https://files.pythonhosted.org/packages/ed/39/15045ae46f2a123019aa968dfcba0396c161c20f855f11dea6796bcaae95/PyMySQL-0.9.3-py2.py3-none-any.whl (47kB)
100% |████████████████████████████████| 51kB 376kB/s
Installing collected packages: pymysql
Successfully installed pymysql-0.9.3
You are using pip version 10.0.1, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
进行更新
提示:输入命令进行更新
C:\Users\Administrator>python -m pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
11% |███▊ | 163kB 15kB/s eta 0:01:19
更新完成
C:\Users\Administrator>python -m pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 14kB/s
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-19.3.1
再执行上面的命令
C:\Users\Administrator> pip install pymysql
报错
C:\Users\Administrator> pip3 install pymysql
Requirement already satisfied: pymysql in d:\program files (x86)\python37-32\lib\site-packages (0.9.3)
对于这样的问题需要指定安装路径
pip install --target=D:\Python\Python38\Lib\site-packagess urllib3
执行命令进行安装
C:\Users\Administrator>pip install --target=D:\Python\Python38\Lib\site-packagess urllib3
Collecting urllib3
Downloading https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl (125kB)
|████████████████████████████████| 133kB 109kB/s
Installing collected packages: urllib3
Successfully installed urllib3-1.25.7
C:\Users\Administrator>
安装完成后输入命令查看是否安装成功
C:\Users\Administrator>pip list
Package Version
---------- -------
pip 19.3.1
PyMySQL 0.9.3
setuptools 41.2.0
C:\Users\Administrator>