升级到Macos Big Sur后Reportlab安装失败

祖尔加加尔·伊斯梅勒扎德(Zulfugar Ismayilzadeh)

升级到MacOS Big Sur后,我正在尝试重新安装虚拟环境。

但是出现错误:

4 warnings generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Qunused-arguments -Qunused-arguments -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION=2.3.21 -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/[email protected]/3.8.6_1/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-parset1.c -o build/temp.macosx-11.0-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-parset1.o
    src/rl_addons/renderPM/gt1/gt1-parset1.c:604:28: warning: for loop has empty body [-Wempty-body]
            for (i = 0; i < size; i++);
                                      ^
    src/rl_addons/renderPM/gt1/gt1-parset1.c:604:28: note: put the semicolon on a separate line to silence this warning
    src/rl_addons/renderPM/gt1/gt1-parset1.c:1907:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
            for (i = 0; i < sizeof(internal_procs) / sizeof(InternalGt1ProcListing); i++)
                        ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/rl_addons/renderPM/gt1/gt1-parset1.c:710:1: warning: function 'print_value_deep' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    print_value_deep (Gt1PSContext *psc, Gt1Value *val, int nest)
    ^
    3 warnings generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Qunused-arguments -Qunused-arguments -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION=2.3.21 -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/[email protected]/3.8.6_1/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-dict.c -o build/temp.macosx-11.0-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-dict.o
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Qunused-arguments -Qunused-arguments -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION=2.3.21 -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/[email protected]/3.8.6_1/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-namecontext.c -o build/temp.macosx-11.0-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-namecontext.o
    src/rl_addons/renderPM/gt1/gt1-namecontext.c:100:9: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
      len = strlen (s);
            ^
    src/rl_addons/renderPM/gt1/gt1-namecontext.c:100:9: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
    src/rl_addons/renderPM/gt1/gt1-namecontext.c:102:3: error: implicitly declaring library function 'memcpy' with type 'void *(void *, const void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
      memcpy (new, s, len);
      ^
    src/rl_addons/renderPM/gt1/gt1-namecontext.c:102:3: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
    src/rl_addons/renderPM/gt1/gt1-namecontext.c:172:10: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
        if (!strcmp (nc->table[i & mask].name, name))
             ^
    src/rl_addons/renderPM/gt1/gt1-namecontext.c:172:10: note: include the header <string.h> or explicitly provide a declaration for 'strcmp'
    3 errors generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/zulfugar/PycharmProjects/AppForm/.venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_w/8xmqn_ys20n91w63y9lcl6nr0000gn/T/pip-install-_q2xgbny/reportlab/setup.py'"'"'; __file__='"'"'/private/var/folders/_w/8xmqn_ys20n91w63y9lcl6nr0000gn/T/pip-install-_q2xgbny/reportlab/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/_w/8xmqn_ys20n91w63y9lcl6nr0000gn/T/pip-record-08bq_70o/install-record.txt --single-version-externally-managed --compile --install-headers /Users/zulfugar/PycharmProjects/AppForm/.venv/include/site/python3.8/reportlab Check the logs for full command output.

我试过了:

重新安装xcode-select --install;

重新安装Python brew install [email protected];

安装了Xcode本身;

以上均无济于事。

可能是什么问题?

祖尔加加尔·伊斯梅勒扎德(Zulfugar Ismayilzadeh)

通过下载源代码并更新来解决问题 src/rl_addons/renderPM/gt1/gt1-namecontext.c

#if defined(_WIN32) || defined(macintosh)
#   include <string.h>
#endif

似乎macintosh没有在MacOS Big Sur上定义,添加时include <string.h>没有if语句并使用python setup.py install

工作了。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章