python使用Pip安装模块

python安装模块通常可使用以下方式:

1、pip install + 模块名

但有时可能报错,如下所示:

Command ""d:\program files\python\python.exe" -u -c "import setuptools, tokenize
;__file__='C:\\Users\\admin\\AppData\\Local\\Temp\\pip-build-jb2gpkp8\\mysql-connec
tor-python-rf\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read
().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" instal
l --record C:\Users\admin\AppData\Local\Temp\pip-6aov94no-record\install-record.txt
 --single-version-externally-managed --compile" failed with error code 1 in C:\U
sers\admin\AppData\Local\Temp\pip-build-jb2gpkp8\mysql-connector-python-rf\

以上是python安装mysql驱动时报错,可采用以下方式:

pip install http://cdn.mysql.com/Downloads/Connector-Python/mysql-co
nnector-python-2.0.4.zip#md5=3df394d89300db95163f17c843ef49df

这便是第二种方式

2、
pip install + 路径(https://pypi.python.org/pypi 搜索关键字,进入后找到相应模块路径)

python使用Pip安装模块_第1张图片

你可能感兴趣的:(python)