收入两个安装关于安装MySQLdb的URL
http://stackoverflow.com/questions/645943/mysql-for-python-in-windows
As Python newbie learning the Python ecosystem I've just completed this.
Install setuptools instructions
Install MySQL 5.1. Download the 97.6MB MSI from here You can't use the essentials version because it doesnt contain the C libraries.
Be sure to select a custom install, and mark the development tools / libraries for installation as that is not done by default. This is needed to get the C header files.
You can verify you have done this correctly by looking in your install directory for a folder named "include". E.G C:\Program Files\MySQL\MySQL Server 5.1\include. It should have a whole bunch of .h files.
Install Microsoft Visual Studio C++ Express 2008 from here This is needed to get a C compiler.
Open up a command line as administrator (right click on the Cmd shortcut and then "run as administrator". Be sure to open a fresh window after you have installed those things or your path won't be updated and the install will still fail.
From the command prompt:
easy_install -b C:\temp\sometempdir mysql-python
That will fail - which is OK.
Now open site.cfg in your temp directory C:\temp\sometempdir and edit the "registry_key" setting to:
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.1
now CD into your temp dir and:
python setup.py clean
python setup.py install
You should be ready to rock!
Here is a super simple script to start off learning the Python DB API for you - if you need it.
http://hi.baidu.com/koflance/blog/item/78ae37f90f66c615a9d311f3.html
Now try to build it again. I got this :
error: build\temp.win32-2.6\Release\_mysql.pyd.manifest : general error c1010070: Failed to load and parse the manifest.
The system cannot find the file specified. error: command ‘mt.exe’ failed with exit status 31 To fix this problem, go to C:\Python26\Lib\distutils, edit msvc9compiler.py, search for ‘MANIFESTFILE’, you will find the following line ld_args.append(’/MANIFESTFILE:’ + temp_manifest) Then append the following line after the above line, ld_args.append(’/MANIFEST’) Then go back to run “setup.py build”, it will succeed.
Finally, run setup.py install Test it in python >>> import MySQLdb >>>
分享到:
相关推荐
On Windows, there are binary wheel you can install without MySQLConnector/C or MSVC. #### Note on Python 3 : if you are using python3 then you need to install python3-dev using the following command...
#OperatorCenter ========= #Config #Flask-WTF https://flask-wtf.readthedocs.org/en/latest/install.html #Flask-WTF $ easy_install Flask-WTF ...http://yuji.wordpress.com/2009/08/31/python-on-window
install-node-msi-version-on-windows-step1 步骤 2 : 点击以上的Run(运行),将出现如下界面: install-node-msi-version-on-windows-step2 步骤 3 : 勾选接受协议选项,点击 next(下一步) 按钮 : install-...
mysql> GRANT ALL PRIVILEGES ON demo_django_supermarket.* TO 'admin'@'localhost'; ``` ### 初始化数据 1. migrate 迁移/初始化数据库 ```bash > python3 manage.py makemigrations > python3 manage.py ...
开发设置先决条件Debian / Ubuntu- sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev python-pip python-setuptools mysql-server mysql-client安装python setup.py developpip install -e ' ...
brew install mysql-connector-c 但是报错: 查看报错信息,在安装 mysql-connector-c 前先 brew unlink mysql 但是继续安装还是报错: 查看官方说明,原来在 macOS 下需将 mysql_config 中的 # on mac
下载zabbix server源码包 `wget -o zabbix-4.0.4.tar.gz <https://sourceforge.net/projects/zabbix/files/ZABBIX Latest Stable/4.0.4/zabbix-4.0.4.tar.gz/download`> ...`yum install wget telnet ...
关于技术如何设置生产服务器参见server_setup.bash设置项目以在本地运行安装virtualenv sudo apt-get install python3-virtualenv 创建一个环境python3 -m venv ./env 安装MySQL并创建必要的用户和表(此代码适用于...
本科毕业设计+python+基于Flask+Bootstrap+Mysql的项目审批系统(含源码+数据库) 安装相关库 $ git clone https://github.com/rmboot/approvalsystem $ cd approvalsystem $ pipenv install $ pipenv shell 初始化...
要求aptitude install python-pip python-dev build-essential libxml2-dev freeswitch-mod-xml-curl \libxslt1-dev libmyodbc unixODBC unixODBC-dev supervisorpip install virtualenv virtualenvwrapperpip ...
python3.9操作mysql必备的包,安装:在安装位置打开CMD,执行pip install mysqlclient-2.0.3-cp39-cp39-win_amd64.whl
sudo apt-get install python-setuptools libmysqlclient-dev mysql-server python-dev python-pip default-jre libxml2-dev libxslt1-dev git pip install fabric virtualenv virtualenvwrapper 安装依赖项,可...
AWS EC2设置//linux-nginx-flask-uwsgi-mysql骨架[烧瓶应用设置]安装包 $ sudo yum install python26-devel nginx gcc gcc-c++ python-setuptools$ sudo easy_install pip$ sudo pip install uwsgi virtualenv$ sudo...
MySQL Metadata Audit曾经是(dbRecorder)[ ]的python版本,但是现在有更多功能。 它旨在在以下情况下通过电子邮件通知: 您的任何表上都有架构更改。 有可变的变化。 有用户权限更改(或新用户)。 最新版本MySQL...
请按照以下步骤操作: 确保您的系统中安装了以下程序点子虚拟环境MySQL的创建一个virtualenv(一个将包含此存储库的虚拟环境) $ virtualenv --python=python3 < your> 安装要求如下$ pip install -r requirements....
apt-get install git mysql-server python-pip python-dev libmysqlclient-dev 创建 openfaqs_admin 用户,可以随意更改密码,但如果您这样做,请务必在 /openfaqs/openfaqs/settings.py 中更新它。 mysql -u ...
If you don’t already have MySQL on your computer, the first step is to download and install MySQL. From there, the examples mirror the sqlite3 examples, including creating a database and table, ...
斯洛文尼亚名字 ... --python=/usr/local/Cellar/python3/3.4.3_2/bin/python3 imena workon imena pip install --upgrade -r requirements.txt make ./data/names.csv 作者 执照 麻省理工学院,2015
$ apt install mariadb-server git python3 $ pip install -r requirements.txt 同样,创建数据库并加载表: $ mysql - uroot - p MariaDB > CREATE DATABASE ninjabot DEFAULT CHARACTER SET utf8mb4 DEFAULT ...
Perhaps as an indication of the collective will of the developers of MySQL, DuBois does not separate Windows 95/98/NT design or development specifics from its main discussions. Platform-independent ...