树莓派4B 官方镜像系统安装Pymssql报错如下:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pymssql
Using cached pymssql-2.2.7.tar.gz (170 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: pymssql
Building wheel for pymssql (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /tmp/tmpmdxzoeuf_in_process.py build_wheel /tmp/tmp2jr093o9
cwd: /tmp/pip-install-uy8w1cde/pymssql_36d0bd3e98c0496da5b4bd3b0eabc8ed
Complete output (27 lines):
setup.py: platform.system() => Linux
setup.py: platform.architecture() => ('32bit', 'ELF')
setup.py: platform.libc_ver() => ('glibc', '2.31')
setup.py: include_dirs => []
setup.py: library_dirs => []
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-cpython-39
creating build/lib.linux-armv7l-cpython-39/pymssql
copying src/pymssql/__init__.py -> build/lib.linux-armv7l-cpython-39/pymssql
running build_ext
cythoning src/pymssql/_mssql.pyx to src/pymssql/_mssql.c
cythoning src/pymssql/_pymssql.pyx to src/pymssql/_pymssql.c
building 'pymssql._mssql' extension
creating build/temp.linux-armv7l-cpython-39
creating build/temp.linux-armv7l-cpython-39/src
creating build/temp.linux-armv7l-cpython-39/src/pymssql
arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.9 -c src/pymssql/_mssql.c -o build/temp.linux-armv7l-cpython-39/src/pymssql/_mssql.o -DMSDBLIB
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 build/temp.linux-armv7l-cpython-39/src/pymssql/_mssql.o -L/usr/lib -lsybdb -lgssapi_krb5 -lkrb5 -lssl -lcrypto -o build/lib.linux-armv7l-cpython-39/pymssql/_mssql.cpython-39-arm-linux-gnueabihf.so
/usr/bin/ld: cannot find -lgssapi_krb5
/usr/bin/ld: cannot find -lkrb5
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for pymssql
Failed to build pymssql
ERROR: Could not build wheels for pymssql which use PEP 517 and cannot be installed directly
解决:
sudo apt-get install python3-pymssql