简体   繁体   English

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

[英]Reportlab installation failed after upgrading to Macos Big Sur

I'm trying to reinstall my virtual env after upgrade to MacOS Big Sur.升级到 MacOS Big Sur 后,我试图重新安装我的虚拟环境。

But error appears:但出现错误:

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/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/python@3.8/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/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/python@3.8/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/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/python@3.8/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.

I tried:我试过:

Reinstall xcode-select --install ;重新安装xcode-select --install ;

Reinstalled Python brew install python@3.8 ;重新安装 Python brew install python@3.8

Installed Xcode itself;安装Xcode本身;

None of above helped.以上都没有帮助。

What can be the issue?可能是什么问题?

这对我有用

CFLAGS="-Wno-error=implicit-function-declaration" pip install reportlab

Fixed issue by downloading source code and updating src/rl_addons/renderPM/gt1/gt1-namecontext.c通过下载源代码并更新src/rl_addons/renderPM/gt1/gt1-namecontext.c

There was

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

Seems macintosh is not defined on MacOS Big Sur, added include <string.h> without if statement and build using python setup.py install似乎macintosh未在 MacOS Big Sur 上定义,添加了include <string.h>不带 if 语句并使用python setup.py install构建

Worked.工作了。

I found that updating my pip requirements.txt pinned version of reportlab from 3.3.x to 3.5.59 (latest as of today) resolved this issue for me.我发现将我的 pip requirements.txt固定版本的reportlab从 3.3.x 更新到 3.5.59(截至今天的最新版本)为我解决了这个问题。

I have not yet done any validation of the changes between those versions.我尚未对这些版本之间的更改进行任何验证。 YMMV!天啊!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM