在Windows上使用PIP编译mysql-python [英] Compiling mysql-python on Windows with PIP

查看:82
本文介绍了在Windows上使用PIP编译mysql-python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我在Windows 7笔记本电脑上安装了Python 2.7和setuptools.我还安装了Visual Studio 2008 Express,并使用开发工具安装了MySQL.

So I have Python 2.7 and setuptools installed on my Windows 7 laptop. I also have Visual Studio 2008 Express installed and MySQL with dev tools.

我正在尝试通过pip安装mysql-python:

I am trying to install mysql-python via pip like:

pip install mysql-python

我收到链接错误:

   Creating library build\temp.win32-2.7\Release\_mysql.lib and object build\temp.win32-2.7\Release\_mysql.exp

_mysql.obj : error LNK2019: unresolved external symbol _mysql_error@4 referenced in function __mysql_Exception

_mysql.obj : error LNK2019: unresolved external symbol _mysql_errno@4 referenced in function __mysql_Exception

_mysql.obj : error LNK2019: unresolved external symbol _mysql_server_init@12 referenced in function __mysql_server_init

_mysql.obj : error LNK2019: unresolved external symbol _mysql_server_end@0 referenced in function __mysql_server_end

_mysql.obj : error LNK2019: unresolved external symbol _mysql_thread_safe@0 referenced in function __mysql_thread_safe

_mysql.obj : error LNK2019: unresolved external symbol _mysql_fetch_fields@4 referenced in function __mysql_ResultObject_Initialize

_mysql.obj : error LNK2019: unresolved external symbol _mysql_num_fields@4 referenced in function __mysql_ResultObject_Initialize

_mysql.obj : error LNK2019: unresolved external symbol _mysql_field_count@4 referenced in function __mysql_ResultObject_Initialize

_mysql.obj : error LNK2019: unresolved external symbol _mysql_store_result@4 referenced in function __mysql_ResultObject_Initialize

_mysql.obj : error LNK2019: unresolved external symbol _mysql_use_result@4 referenced in function __mysql_ResultObject_Initialize

_mysql.obj : error LNK2019: unresolved external symbol _mysql_real_connect@32 referenced in function __mysql_ConnectionObject_Initialize

_mysql.obj : error LNK2019: unresolved external symbol _mysql_ssl_set@24 referenced in function __mysql_ConnectionObject_Initialize

_mysql.obj : error LNK2019: unresolved external symbol _mysql_options@12 referenced in function __mysql_ConnectionObject_Initialize

_mysql.obj : error LNK2019: unresolved external symbol _mysql_init@4 referenced in function __mysql_ConnectionObject_Initialize

_mysql.obj : error LNK2019: unresolved external symbol _mysql_close@4 referenced in function __mysql_ConnectionObject_close

_mysql.obj : error LNK2019: unresolved external symbol _mysql_affected_rows@4 referenced in function __mysql_ConnectionObject_affected_rows

_mysql.obj : error LNK2019: unresolved external symbol _mysql_debug@4 referenced in function __mysql_debug

_mysql.obj : error LNK2019: unresolved external symbol _mysql_dump_debug_info@4 referenced in function __mysql_ConnectionObject_dump_debug_info

_mysql.obj : error LNK2019: unresolved external symbol _mysql_autocommit@8 referenced in function __mysql_ConnectionObject_autocommit

_mysql.obj : error LNK2019: unresolved external symbol _mysql_commit@4 referenced in function __mysql_ConnectionObject_commit

_mysql.obj : error LNK2019: unresolved external symbol _mysql_rollback@4 referenced in function __mysql_ConnectionObject_rollback

_mysql.obj : error LNK2019: unresolved external symbol _mysql_next_result@4 referenced in function __mysql_ConnectionObject_next_result

_mysql.obj : error LNK2019: unresolved external symbol _mysql_set_server_option@8 referenced in function __mysql_ConnectionObject_set_server_option

_mysql.obj : error LNK2019: unresolved external symbol _mysql_sqlstate@4 referenced in function __mysql_ConnectionObject_sqlstate

_mysql.obj : error LNK2019: unresolved external symbol _mysql_warning_count@4 referenced in function __mysql_ConnectionObject_warning_count

_mysql.obj : error LNK2019: unresolved external symbol _mysql_escape_string@12 referenced in function __mysql_escape_string

_mysql.obj : error LNK2019: unresolved external symbol _mysql_real_escape_string@16 referenced in function __mysql_escape_string

_mysql.obj : error LNK2019: unresolved external symbol _mysql_fetch_lengths@4 referenced in function __mysql_row_to_tuple

_mysql.obj : error LNK2019: unresolved external symbol __imp__strncpy referenced in function __mysql_row_to_dict

_mysql.obj : error LNK2019: unresolved external symbol __imp__strncat referenced in function __mysql_row_to_dict

_mysql.obj : error LNK2019: unresolved external symbol _memset referenced in function __mysql_row_to_dict_old

_mysql.obj : error LNK2019: unresolved external symbol _mysql_fetch_row@4 referenced in function __mysql__fetch_row

_mysql.obj : error LNK2019: unresolved external symbol _mysql_num_rows@4 referenced in function __mysql_ResultObject_fetch_row

_mysql.obj : error LNK2019: unresolved external symbol _mysql_change_user@16 referenced in function __mysql_ConnectionObject_change_user

_mysql.obj : error LNK2019: unresolved external symbol _mysql_character_set_name@4 referenced in function __mysql_ConnectionObject_character_set_name

_mysql.obj : error LNK2019: unresolved external symbol _mysql_set_character_set@8 referenced in function __mysql_ConnectionObject_set_character_set

_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_character_set_info@8 referenced in function __mysql_ConnectionObject_get_character_set_info

_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_client_info@0 referenced in function __mysql_get_client_info

_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_host_info@4 referenced in function __mysql_ConnectionObject_get_host_info

_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_proto_info@4 referenced in function __mysql_ConnectionObject_get_proto_info

_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_server_info@4 referenced in function __mysql_ConnectionObject_get_server_info

_mysql.obj : error LNK2019: unresolved external symbol _mysql_info@4 referenced in function __mysql_ConnectionObject_info

_mysql.obj : error LNK2019: unresolved external symbol _mysql_insert_id@4 referenced in function __mysql_ConnectionObject_insert_id

_mysql.obj : error LNK2019: unresolved external symbol _mysql_kill@8 referenced in function __mysql_ConnectionObject_kill

_mysql.obj : error LNK2019: unresolved external symbol _mysql_ping@4 referenced in function __mysql_ConnectionObject_ping

_mysql.obj : error LNK2019: unresolved external symbol _mysql_real_query@12 referenced in function __mysql_ConnectionObject_query

_mysql.obj : error LNK2019: unresolved external symbol _mysql_select_db@8 referenced in function __mysql_ConnectionObject_select_db

_mysql.obj : error LNK2019: unresolved external symbol _mysql_shutdown@8 referenced in function __mysql_ConnectionObject_shutdown

_mysql.obj : error LNK2019: unresolved external symbol _mysql_stat@4 referenced in function __mysql_ConnectionObject_stat

_mysql.obj : error LNK2019: unresolved external symbol _mysql_thread_id@4 referenced in function __mysql_ConnectionObject_thread_id

_mysql.obj : error LNK2019: unresolved external symbol __imp__sprintf referenced in function __mysql_ConnectionObject_repr

_mysql.obj : error LNK2019: unresolved external symbol _mysql_data_seek@12 referenced in function __mysql_ResultObject_data_seek

_mysql.obj : error LNK2019: unresolved external symbol _mysql_row_seek@8 referenced in function __mysql_ResultObject_row_seek

_mysql.obj : error LNK2019: unresolved external symbol _mysql_row_tell@4 referenced in function __mysql_ResultObject_row_seek

_mysql.obj : error LNK2019: unresolved external symbol _mysql_free_result@4 referenced in function __mysql_ResultObject_dealloc

LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12

build\lib.win32-2.7\_mysql.pyd : fatal error LNK1120: 56 unresolved externals

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BIN\\link.exe' failed with exit status 1120

任何想法如何解决此问题?谢谢

Any ideas how to solve this issue? Thanks

推荐答案

我遇到了相同的问题,并且出现了完全相同的错误.我不知道为什么,但是

I had the same problem and exact same errors.I don't know why but

pip install Mysql-python

产生错误. 但是当我尝试

gave errors. But when I tried

easy_install Mysql-python

它起作用了.我不知道为什么,但是它起作用了,但是很想知道为什么.

It worked.I don't know why but it did work but would love to know why.

这篇关于在Windows上使用PIP编译mysql-python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆