0

几个月前我用python写了一个脚本。在这个脚本中,我使用编织。这个脚本曾经可以工作,但几个月后我今天重新尝试运行我的程序,但它不再工作了。我收到此错误:

USAGE: facedetect.py [--cascade <cascade_fn>] [--nested-cascade <cascade_fn>] [<video_source>]

Found executable C:\strawberry\c\bin\g++.exe
c:/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\python2.7\libs/libpython27.a when searching for -lpython27
c:/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\python2.7\libs/python27.lib when searching for -lpython27
c:/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\python2.7\libs\libpython27.a when searching for -lpython27
c:/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\python2.7\libs/libpython27.a when searching for -lpython27
c:/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\python2.7\libs/python27.lib when searching for -lpython27
c:/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\python2.7\libs\python27.lib when searching for -lpython27
c:/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lpython27
collect2: ld returned 1 exit status
Traceback (most recent call last):
  File "C:\Users\Olivier.Janssens\Documents\onlinelearning\onlinelearning\facedetect.py", line 87, in <module>
    processFrame(roi,gabor)
  File "C:\Users\Olivier.Janssens\Documents\onlinelearning\onlinelearning\facedetect.py", line 51, in processFrame
    im = Image.fromarray(gabor.rlbp_fast_blitz(superimposed[(i*stepHeight):((i+1)*stepHeight),(j*stepWidth):((j+1)*stepWidth)]))
  File "C:\Users\Olivier.Janssens\Documents\onlinelearning\onlinelearning\gaborModule.py", line 80, in rlbp_fast_blitz
    weave.blitz(expr, arg_dict, check_size=0)
  File "C:\python2.7\lib\site-packages\scipy\weave\blitz_tools.py", line 62, in blitz
    **kw)
  File "C:\python2.7\lib\site-packages\scipy\weave\inline_tools.py", line 482, in compile_function
    verbose=verbose, **kw)
  File "C:\python2.7\lib\site-packages\scipy\weave\ext_tools.py", line 367, in compile
    verbose = verbose, **kw)
  File "C:\python2.7\lib\site-packages\scipy\weave\build_tools.py", line 272, in build_extension
    setup(name = module_name, ext_modules = [ext],verbose=verb)
  File "C:\python2.7\lib\site-packages\numpy\distutils\core.py", line 186, in setup
    return old_setup(**new_attr)
  File "C:\python2.7\lib\distutils\core.py", line 169, in setup
    raise SystemExit, "error: " + str(msg)
distutils.errors.CompileError: error: Command "g++ -shared c:\users\olivie~1.jan\appdata\local\temp\Olivier.Janssens\python27_intermediate\compiler_5b1f9617507e215394a4b4c2536b23c6\Release\users\olivie~1.jan\appdata\local\temp\olivier.janssens\python27_compiled\sc_24e057e16c3730b6904be220694a322419.o c:\users\olivie~1.jan\appdata\local\temp\Olivier.Janssens\python27_intermediate\compiler_5b1f9617507e215394a4b4c2536b23c6\Release\python2.7\lib\site-packages\scipy\weave\scxx\weave_imp.o -LC:\python2.7\libs -LC:\python2.7\PCbuild -lpython27 -lmsvcr90 -o c:\users\olivie~1.jan\appdata\local\temp\Olivier.Janssens\python27_compiled\sc_24e057e16c3730b6904be220694a322419.pyd" failed with exit status 1

错误状态:找不到-lpython27

这是文件夹的样子(程序正在使用)

在此处输入图像描述

一些额外的信息:我有一台 64 位的电脑,运行 Windows 7,python 是 32 位的。

最近我的 Path 变量被清除了,虽然我已经添加了 python 路径,也许我也需要在这里添加一些东西?

4

1 回答 1

1

正在查找 python27.lib (在 python 文件夹中),但由于它是用 Visual C++ 构建的并且您正在使用 gcc 而跳过它最有可能是不兼容的 - 您可能在您的路径上有一个 gcc 构建的 python - 如果是这样,您需要将其添加回来或设置链接器路径以包括.当前目录。

于 2013-08-22T07:10:02.400 回答