“对‘_head_libpython27_a’的未定义引用”
所以,我一直在尝试安装 py-notify (现在我在尝试安装 cython 时遇到了同样的问题),但是这次我遇到了一个无法通过 Google 修复的问题(现在唯一的结果是这个问题......)。
首先,我遇到了这个问题: http://pastebin.com/0hs6ngsj
按照此页面上的过程创建文件 libpython27.a
(这似乎是所需要的),并将其放入 C:\Python27\libs\
中,我现在收到此错误:
C:\...>easy_install py-notify
Searching for py-notify
Reading http://pypi.python.org/simple/py-notify/
Reading http://home.gna.org/py-notify/
Reading http://download.gna.org/py-notify/
Best match: py-notify 0.3.1
Downloading http://pypi.python.org/packages/source/p/py-notify/py-notify-0.3.1.tar.gz#md5=58428761bc196bf9b1f1d930991ee3ca
Processing py-notify-0.3.1.tar.gz
Running py-notify-0.3.1\setup.py -q bdist_egg --dist-dir c:\users\nightkev\appdata\local\temp\easy_install-qfiohj\py-notify-0.3.1\egg-dist-tmp-zoe6ad
C:\Python27\libs\libpython27.a(dwtms01015.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00254.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00713.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00221.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00008.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00338.o):(.idata$7+0x0): more undefined references to `_head_libpython27_a' follow
collect2: ld returned 1 exit status
dllwrap: gcc exited with status 1
error: Setup script exited with error: command 'dllwrap' failed with exit status 1
Python info:
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win32
OS: Windows 7 Professional Edition x64
我不确定我可能需要提供哪些其他信息。
So, I've been trying to install py-notify (now I've been running into the same problems with trying to install cython), but I've run into a problem that I wasn't able to fix with Google this time (the only results are for this question now...).
First, I was running into this problem: http://pastebin.com/0hs6ngsj
After following the procedure on this page to create the file libpython27.a
(which seemed to be what is required), and putting it into C:\Python27\libs\
, I now get this error instead:
C:\...>easy_install py-notify
Searching for py-notify
Reading http://pypi.python.org/simple/py-notify/
Reading http://home.gna.org/py-notify/
Reading http://download.gna.org/py-notify/
Best match: py-notify 0.3.1
Downloading http://pypi.python.org/packages/source/p/py-notify/py-notify-0.3.1.tar.gz#md5=58428761bc196bf9b1f1d930991ee3ca
Processing py-notify-0.3.1.tar.gz
Running py-notify-0.3.1\setup.py -q bdist_egg --dist-dir c:\users\nightkev\appdata\local\temp\easy_install-qfiohj\py-notify-0.3.1\egg-dist-tmp-zoe6ad
C:\Python27\libs\libpython27.a(dwtms01015.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00254.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00713.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00221.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00008.o):(.idata$7+0x0): undefined reference to `_head_libpython27_a'
C:\Python27\libs\libpython27.a(dwtms00338.o):(.idata$7+0x0): more undefined references to `_head_libpython27_a' follow
collect2: ld returned 1 exit status
dllwrap: gcc exited with status 1
error: Setup script exited with error: command 'dllwrap' failed with exit status 1
Python info:
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win32
OS: Windows 7 Professional Edition x64
I'm unsure what other information I might need to provide.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也有同样的问题。我能想到的最佳解决方案是废弃 MinGW 并安装 Visual Studio。对于 Python 2.7,您需要 Visual Studio C++ Express Edition 2008(请注意,2010 不起作用!)
http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express
如果您想出一个适用于请让我知道。
I'm having the same problem. The best solution I could come up with was to scrap MinGW and install Visual Studio. For Python 2.7 you need Visual Studio C++ Express Edition 2008 (note that 2010 won't work!)
http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express
If you come up with an answer that works with MinGW please let me know.