C:\>pip install MYSQL-python -i http://mirrors.aliyun.com/pypi/simple --trusted- host mirrors.aliyun.com 报错,按报错提示执行: python -m pip install --upgrade pip 不成功,因为服务器连接超时,使用一下代码即可解决 python -m pip install --upgrade pip -i https://pypi.douban.com/simple 成功,然后返回去第一步: C:\>pip install MYSQL-python -i http://mirrors.aliyun.com/pypi/simple --trusted- host mirrors.aliyun.com 还是报错: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual 安装64b的后还是报错 安装32b的后还是报错 只好直接安装whl: pip install "F:\tools.syant\python.syant\package\mysql-pytho n\mysqlclient-1.4.2-cp37-cp37m-win32.whl" pip install "E:\NagoCloud\public\mysql-python\mysqlclient-1.4.2-cp37-cp37m-win32.whl" 成功 装itchat据说一定要pip3 pip3 install itchat -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com |
You are running your code with Python 3.x, but your code scheme for try.. except section is for Python 2.X. If you want to run your code with Python 3.x, then change this line: except MySQLdb.Error, e: To: except MySQLdb.Error as e: And if you want this section of code works with Python 2.x and also Python 3.x, then change it to: except MySQLdb.Error: e = sys.exc_info()[1] |
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.