python安装mysql的命令_在windows中安装mysql时出现命令错误

博主在Windows 8 64位系统中使用32位Python 2.7安装mysql-python时遇到错误,提示需要Microsoft Visual C++ 9.0且无法找到vcvarsall.bat文件。博主寻求帮助以解决该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我使用的是windows 8 64位操作系统。运行32位的Python2.7(因为我需要只在这个版本上运行的包)。我试图从commandpromt安装mysql和mysql。我以管理员的身份运行cmd。我使用:cd C:/Python27/Scripts

pip install mysql-python

我得到这个错误:

^{pr2}$

我还尝试了mysqldb的MySQL python安装,并得到了类似的错误消息。这是出错前的总输出。请帮我修好这个。在C:\Python27\Scripts>pip install mysql-python

You are using pip version 7.0.1, however version 7.1.0 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

Collecting mysql-python

Using cached MySQL-python-1.2.5.zip

Installing collected packages: mysql-python

Running setup.py install for mysql-python

Complete output from command C:\Python27\python.exe -c "import setuptools, t

okenize;__file__='c:\\users\\troy\\appdata\\local\\temp\\pip-build-yn2u15\\mysql

-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read()

.replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\troy\appda

ta\local\temp\pip-ohzg7c-record\install-record.txt --single-version-externally-m

anaged --compile:

running install

running build

running build_py

creating build

creating build\lib.win32-2.7

copying _mysql_exceptions.py -> build\lib.win32-2.7

creating build\lib.win32-2.7\MySQLdb

copying MySQLdb\__init__.py -> build\lib.win32-2.7\MySQLdb

copying MySQLdb\converters.py -> build\lib.win32-2.7\MySQLdb

copying MySQLdb\connections.py -> build\lib.win32-2.7\MySQLdb

copying MySQLdb\cursors.py -> build\lib.win32-2.7\MySQLdb

copying MySQLdb\release.py -> build\lib.win32-2.7\MySQLdb

copying MySQLdb\times.py -> build\lib.win32-2.7\MySQLdb

creating build\lib.win32-2.7\MySQLdb\constants

copying MySQLdb\constants\__init__.py -> build\lib.win32-2.7\MySQLdb\constan

ts

copying MySQLdb\constants\CR.py -> build\lib.win32-2.7\MySQLdb\constants

copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-2.7\MySQLdb\const

ants

copying MySQLdb\constants\ER.py -> build\lib.win32-2.7\MySQLdb\constants

copying MySQLdb\constants\FLAG.py -> build\lib.win32-2.7\MySQLdb\constants

copying MySQLdb\constants\REFRESH.py -> build\lib.win32-2.7\MySQLdb\constant

s

copying MySQLdb\constants\CLIENT.py -> build\lib.win32-2.7\MySQLdb\constants

running build_ext

building '_mysql' extension

error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat).

Get it from http://aka.ms/vcpython27

----------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值