所以我在我的Windows 7笔记本电脑上安装了Python 2.7和setuptools。我还安装了Visual Studio 2008 Express和MysqL与开发工具。

我试图通过pip安装MysqL-python:

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

任何想法如何解决这个问题?谢谢

检查两者是32位还是64位,并且它们之间没有不匹配。当我遇到这个问题的时候,是因为我安装了一个64位的Python,但是安装了一个32位的MysqL。因此,pip安装程序可能无法找到要链接到的匹配二进制文件,并且此消息失败。解决这个问题只是一个将顶级的32位Python安装在一起的问题,一切正常。

请注意,也可能将MysqL更新为64位,但目前MysqL的安装程序似乎只有32位。您可以通过从官方MysqL站点下载的.zip文件进行安装,尽管它具有64位二进制文​​件。

了解您已安装的:

>对于Python,只需转到命令行并键入python。它应该显示什么版本,如果它是一个32位或64位安装如此

Python 2.7.10 (default,May 23 2015,09:40:32) [MSC v.1500 32 bit (Intel)] on win32

>对于MysqL,最简单的方法可能是安装在哪个文件夹中。如果安装到Program Files /,那么它是64位,但如果安装到Program Files(x86)/它是32位

使用PIP在Windows上编译mysql-python的更多相关文章

  1. ios – 从Live Photo中提取视频部分

    有没有人想出如何从LivePhoto中提取视频部分?

  2. ios – 使用Swift的Lumberjack 2.0记录器

    我以前使用物镜C的Lumberjack记录器,我喜欢它.现在我开始学习Swift,我不能在那里使用我最喜欢的记录器.有人可以一步一步地写出我能做到的事吗?在Lumberjack2.0发布之前,我尝试在这里找到一些东西,但所有主题都是自定义包装器.我做了什么:>我用Cocoapods添加了Lumberjack;>我将“#import”添加到Bridging-Header文件中.我不知道接下来该怎么办?因为在ObjC中我有宏:staticconstintddLogLevel=LOG_LEVEL_INFO;el

  3. XCode 3.2 Ruby和Python模板

    在xcode3.2下,我的ObjectiveCPython/Ruby项目仍然可以打开更新和编译,但是你无法创建新项目.鉴于xcode3.2中缺少ruby和python的所有痕迹(即创建项目并添加新的ruby/python文件),是否有一种简单的方法可以再次安装模板?我发现了一些关于将它们复制到某个文件夹的信息,但我似乎无法让它工作,我怀疑文件夹的位置已经改变为3.2.解决方法3.2中的应用程序模板

  4. .dylib在Debug中链接,在XCode中找不到适用于iPhone的版本

    所以我已经将libxml2.2.dylib库包含在我的iPhoneXCode项目中,以创建一些Xml和XPath解析实用程序.当我编译并运行在模拟器和设备的调试模式时,我没有问题,但是,当我切换到发布模式我得到…

  5. 在编译的iOS应用程序(IPA)中加密内容

    由于IPA结构只是一个压缩文件,包含编译代码媒体内容,如图像&音频,我如何保护内容免受别人的窃取?是否有加密可以添加到IPA?

  6. 从iOS应用程序发送帖子到PHP脚本不工作…简单的解决方案就像

    我之前已经做了好几次了但是由于某些原因我无法通过这个帖子…我尝试了设置为_POST且没有的变量的PHP脚本……当它们未设置为发布时它工作精细.这是我的iOS代码:这里是PHP的一大块,POST变量不在正确的位置?我想这对于更有经验的开发人员来说是一个相当简单的答案,感谢您的帮助!解决方法$_POST是一个数组,而不是一个函数.您需要使用方括号来访问数组索引:

  7. ios – 从embedded.mobileprovision配置文件获取证书到期日期

    谁可以帮我进一步?

  8. ios – Swift 4向后兼容性

    一起使用.有没有办法在两个版本的Xcode中使这个工作?Swift4是否应该向后兼容?

  9. swift语言IOS8开发战记22 Core Data3

    上一话我们定义了与coredata有关的变量和方法,做足了准备工作,这一话我们来试试能不能成功。首先打开上一话中生成的Info类,在其中引用头文件的地方添加一个@objc,不然后面会报错,我也不知道为什么。

  10. Swift与OC混合编译

    SWift调用OC新建swift文件此时系统自动生成-Bridging-Header.h文件并且TARGETS->BuildSettings->Objective-CBridgingHeader(搜索bridg)选项中会自动填入以上头文件的路径在-Bridging-Header.h中#import要调用的OC对象头文件OC调用Swift在OC文件中#import“

随机推荐

  1. static – 在页面之间共享数据的最佳实践

    我想知道在UWP的页面之间发送像’selectedItem’等变量的最佳做法是什么?创建一个每个页面都知道的静态全局变量类是一个好主意吗?

  2. .net – 为Windows窗体控件提供百分比宽度/高度

    WindowsForm开发的新手,但在Web开发方面经验丰富.有没有办法为Windows窗体控件指定百分比宽度/高度,以便在用户调整窗口大小时扩展/缩小?当窗口调整大小时,可以编写代码来改变控件的宽度/高度,但我希望有更好的方法,比如在HTML/CSS中.在那儿?

  3. 使用Windows Azure查询表存储数据

    我需要使用特定帐户吗?>将应用程序部署到Azure服务后,如何查询数据?GoogleAppEngine有一个数据查看器/查询工具,Azure有类似的东西吗?>您可以看到的sqlExpressintance仅在开发结构中,并且一旦您表示没有等效,所以请小心使用它.>您可以尝试使用Linqpad查询表格.看看JamieThomson的thispost.

  4. windows – SetupDiGetClassDevs是否与文档中的设备实例ID一起使用?

    有没有更好的方法可以使用DBT_DEVICEARRIVAL事件中的数据获取设备的更多信息?您似乎必须指定DIGCF_ALLCLASSES标志以查找与给定设备实例ID匹配的所有类,或者指定ClassGuid并使用DIGCF_DEFAULT标志.这对我有用:带输出:

  5. Windows Live ID是OpenID提供商吗?

    不,WindowsLiveID不是OpenID提供商.他们使用专有协议.自从他们的“测试版”期结束以来,他们从未宣布计划继续它.

  6. 如果我在代码中进行了更改,是否需要重新安装Windows服务?

    我写了一个Windows服务并安装它.现在我对代码进行了一些更改并重新构建了解决方案.我还应该重新安装服务吗?不,只需停止它,替换文件,然后重新启动它.

  7. 带有双引号的字符串回显使用Windows批处理输出文件

    我正在尝试使用Windows批处理文件重写配置文件.我循环遍历文件的行并查找我想要用指定的新行替换的行.我有一个’函数’将行写入文件问题是%Text%是一个嵌入双引号的字符串.然后失败了.可能还有其他角色也会导致失败.如何才能使用配置文件中的所有文本?尝试将所有“在文本中替换为^”.^是转义字符,因此“将被视为常规字符你可以尝试以下方法:其他可能导致错误的字符是:

  8. .net – 将控制台应用程序转换为服务?

    我正在寻找不同的优势/劣势,将我们长期使用的控制台应用程序转换为Windows服务.我们为ActiveMQ使用了一个叫做java服务包装器的东西,我相信人们告诉我你可以用它包装任何东西.这并不是说你应该用它包装任何东西;我们遇到了这个问题.控制台应用程序是一个.NET控制台应用程序,默认情况下会将大量信息记录到控制台,尽管这是可配置的.任何推荐?我们应该在VisualStudio中将其重建为服务吗?我使用“-install”/“-uninstall”开关执行此操作.例如,seehere.

  9. windows – 捕获外部程序的STDOUT和STDERR *同时*它正在执行(Ruby)

    哦,我在Windows上:-(实际上,它比我想象的要简单,这看起来很完美:…是的,它适用于Windows!

  10. windows – 当我试图批量打印变量时,为什么我得到“Echo is on”

    我想要执行一个简单的批处理文件脚本:当我在XP中运行时,它给了我预期的输出,但是当我在Vista或Windows7中运行它时,我在尝试打印值时得到“EchoisOn”.以下是程序的输出:摆脱集合表达式中的空格.等号(=)的两侧可以并且应该没有空格BTW:我通常在@echo关闭的情况下启动所有批处理文件,并以@echo结束它们,所以我可以避免将代码与批处理文件的输出混合.它只是使您的批处理文件输出更好,更清洁.

返回
顶部