【问题标题】:How to install pyinstaller on aix7.1如何在 aix7.1 上安装 pyinstaller
【发布时间】:2019-11-11 18:18:16
【问题描述】:

我想在 aix7.1 上安装 pyinstaller,但是失败了。

我已经安装了 zlib-devel。

这是安装pyinstaller时的错误信息:

-bash-4.2# python ./waf distclean all   

'distclean' finished successfully (0.203s)
'all' finished successfully (0.000s)
'distclean' finished successfully (0.000s)
Setting top to                           : /u02/py/pyinstaller-develop/bootloader 
Setting out to                           : /u02/py/pyinstaller-develop/bootloader/build 
Python Version                           : 2.7.10 (default, Jun 21 2016, 10:30:16) [C] 
Checking for 'xlc' (C compiler)          : not found 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking size of pointer                 : 4 
Platform                                 : AIX-32bit detected based on compiler 
Checking for flags -maix32               : yes 
Checking for program '/usr/bin/strip'    : /usr/bin/strip 
Checking for program 'strip'             : /usr/bin/strip 
Checking for library dl                  : yes 
Checking for library m                   : yes 
Checking for library z                   : yes 
Checking for function unsetenv           : yes 
Checking for function mkdtemp            : yes 
'configure' finished successfully (2.248s)
'make_all' finished successfully (0.018s)
Waf: Entering directory `/u02/py/pyinstaller-develop/bootloader/build/debug'
[ 1/13] Compiling src/main.c
[ 2/13] Compiling src/pyi_archive.c
[ 3/13] Compiling src/pyi_global.c
[ 4/13] Compiling src/pyi_launch.c
[ 5/13] Compiling src/pyi_main.c
[ 6/13] Compiling src/pyi_path.c
[ 7/13] Compiling src/pyi_python.c
[ 8/13] Compiling src/pyi_python27_compat.c
[ 9/13] Compiling src/pyi_pythonlib.c
[10/13] Compiling src/pyi_utils.c
[11/13] Compiling src/pyi_win32_utils.c
[12/13] Linking build/debug/run_d
collect2: library libZ not found

Waf: Leaving directory `/u02/py/pyinstaller-develop/bootloader/build/debug'
Build failed
 -> task in 'run_d' failed with exit status 1 (run with -v to display more information)
-bash-4.2# 
-bash-4.2# 
-bash-4.2# 
-bash-4.2# find / -name libz.so
/opt/freeware/lib/libz.so
/opt/freeware/lib64/libz.so
/usr/lib/libz.so
/usr/lib64/libz.so
-bash-4.2# 

【问题讨论】:

  • 另外,正如它所说,run with -v to display more informationlibrary libZ not foundChecking for 'xlc' (C compiler): not found。你错过了这两个。
  • [12/13] 链接 build/debug/run_d 11:47:03 runner ['/usr/bin/gcc', '-maix32', '-Wl,-brtl', 'src /main.c.1.o'、'src/pyi_archive.c.1.o'、'src/pyi_global.c.1.o'、'src/pyi_launch.c.1.o'、'src/pyi_main .c.1.o'、'src/pyi_path.c.1.o'、'src/pyi_python.c.1.o'、'src/pyi_python27_compat.c.1.o'、'src/pyi_pythonlib.c .1.o'、'src/pyi_utils.c.1.o'、'src/pyi_win32_utils.c.1.o'、'-o'、'/u02/py/pyinstaller-develop/bootloader/build/debug /run_d', '-Wl,-bstatic', '-lZ', '-Wl,-bdynamic', '-ldl', '-lm'] collect2: 找不到库 libZ
  • 当我使用 -v 运行时,它显示如下 [12/13] Linking build/debug/run_d 11:47:03 runner ['/usr/bin/gcc', '-maix32' , '-Wl,-brtl', 'src/main.c.1.o', 'src/pyi_archive.c.1.o', 'src/pyi_global.c.1.o', 'src/pyi_launch. c.1.o'、'src/pyi_main.c.1.o'、'src/pyi_path.c.1.o'、'src/pyi_python.c.1.o'、'src/pyi_python27_compat.c。 1.o'、'src/pyi_pythonlib.c.1.o'、'src/pyi_utils.c.1.o'、'src/pyi_win32_utils.c.1.o'、'-o'、'/u02/ py/pyinstaller-develop/bootloader/build/debug/run_d', '-Wl,-bstatic', '-lZ', '-Wl,-bdynamic', '-ldl', '-lm'] collect2: 库 libZ没找到
  • -lZ 是什么意思?是-lz 拼错了吗?
  • 当我将 libz.a 复制到 libZ.a 时,它通过了! cp /usr/lib/libz.a /usr/lib/libZ.a 但是出现了一些新的错误: [14/14] Processing build/debug/run_d + install /u02/py/pyinstaller-develop/PyInstaller/bootloader /AIX-32bit/run_d (from build/debug/run_d) strip: run_d -- 0654-420 该文件已按指定剥离。 Waf:离开目录`/u02/py/pyinstaller-develop/bootloader/build/debug'构建失败->'run_d'中的任务失败,退出状态为255(使用-v运行以显示更多信息)-bash-4.2#

标签: pyinstaller zlib aix


【解决方案1】:

首先,编辑bootloader/wscript文件

--- wscript.bak 2018-09-09 20:12:10.000000000 +0200
+++ wscript     2019-07-02 10:57:30.000000000 +0200
@@ -770,8 +770,9 @@
          staticlibs = []
          if ctx.env.DEST_OS == 'aix':
              # link statically with zlib
-             libs.remove('Z')
-             staticlibs.append('Z')
+             # libs.remove('Z')
+             # staticlibs.append('Z')
+             pass

          if ctx.options.boehmgc:
              libs.append('GC')

然后创建一个名为/opt/freeware/bin/strip的脚本,内容如下:

#!/bin/sh
/usr/bin/strip "$@"
exit 0

别忘了chmod +x /opt/freeware/bin/strip

函数mkdtemp也有问题,解决方法如下:

export CPPFLAGS='-D_XOPEN_SOURCE=700'
python ./waf -v all

注意:您应该知道 AIX 本身就存在很大的问题,但是将它与 帮助软件(比如这个 waf)结合使用会使情况变得更糟。补充阅读:http://lzsiga.users.sourceforge.net/aix-linking.html#Q0026

【讨论】:

    猜你喜欢
    • 2013-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-01
    • 2016-12-09
    • 2018-11-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多