Loading... # 引言 为了实现中转服务器的操作,我需要使用python和`paramiko`,实现ssh的操作,但是`paramiko`需要`pynacl`,正常安装时候会报错,通过百度和`gpt`,都没有找到解决方案。 我是用的是原生的termux,并没有proot一些其他系统。 # 过程 正常安装 ```bash pip install paramiko ``` 报错的摘选 ```bash ./config.status: 1: eval: print: not found ./config.status: 1: eval: print: not found ./config.status: 1: eval: print: not found ./config.status: 1: eval: print: not found ./config.status: 1: eval: print: not found ./config.status: 1: eval: print: not found ./config.status: 1: eval: print: not found ./config.status: 1: eval: print: not found ./config.status: 1: eval: print: not found ./config.status: 1: eval: print: not found config.status: creating Makefile config.status: creating builds/Makefile config.status: creating contrib/Makefile config.status: creating dist-build/Makefile config.status: creating libsodium.pc config.status: creating libsodium-uninstalled.pc config.status: creating msvc-scripts/Makefile config.status: creating src/Makefile config.status: creating src/libsodium/Makefile config.status: creating src/libsodium/include/Makefile config.status: creating src/libsodium/include/sodium/version.h config.status: creating test/default/Makefile config.status: creating test/Makefile config.status: executing depfiles commands config.status: executing libtool commands Making all in builds make[1]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/builds' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/builds' Making all in contrib make[1]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/contrib' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/contrib' Making all in dist-build make[1]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/dist-build' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/dist-build' Making all in msvc-scripts make[1]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/msvc-scripts' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/msvc-scripts' Making all in src make[1]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/src' Making all in libsodium make[2]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/src/libsodium' Making all in include make[3]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/src/libsodium/include' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/src/libsodium/include' make[3]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/src/libsodium' CC crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo ../../libtool: 363: Syntax error: "}" unexpected make[3]: *** [Makefile:2319: crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo] Error 2 make[3]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/src/libsodium' make[2]: *** [Makefile:3112: all-recursive] Error 1 make[2]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/src/libsodium' make[1]: *** [Makefile:406: all-recursive] Error 1 make[1]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-install-s3kcq4bd/pynacl_6c020fac197245b6813b0382cad319c6/build/temp.linux-aarch64-cpython-311/src' make: *** [Makefile:522: all-recursive] Error 1 Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel return _build_backend().build_wheel(wheel_directory, config_settings, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 415, in build_wheel return self._build_with_temp_dir( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir self.run_setup() File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup exec(code, locals()) File "<string>", line 202, in <module> File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 108, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 184, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 200, in run_commands dist.run_commands() File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands self.run_command(cmd) File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 945, in run_command super().run_command(command) File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 989, in run_command cmd_obj.run() File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 373, in run self.run_command("build") File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command self.distribution.run_command(command) File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 945, in run_command super().run_command(command) File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 989, in run_command cmd_obj.run() File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command self.distribution.run_command(command) File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 945, in run_command super().run_command(command) File "/data/data/com.termux/files/usr/tmp/pip-build-env-jmm1xehr/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 989, in run_command cmd_obj.run() File "<string>", line 169, in run File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['make']' returned non-zero exit status 2. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pynacl Failed to build pynacl ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pynacl) ``` 发现是pynacl的问题,并且通过c进行编译的 那考虑一下安装二进制包? ```bash pip install pynacl --no-binary numpy ``` 不行,还是相同的报错。 ChatGPT告诉我git拉源码,我报有怀疑的态度也试了试,因为源码肯定会编译呀,难不成和pip不一样?结果依然是报错。 试试换个版本?1.5.0,1.4.0,1.3.0都一个样。 谷歌搜搜吧,最后在GitHub上找到了一个高赞回复。 ```bash $ pkg install clang python-dev libffi-dev openssl-dev libsodium-dev $ SODIUM_INSTALL=system pip install pynacl ``` 当我执行`SODIUM_INSTALL=system pip install pynacl `时就正确安装了。 ![image.png](https://www.zunmx.top/usr/uploads/2024/07/375236700.png) # 结语 感悟吧,最近比较依赖gpt,虽然很大程度上提高了效率,但是还是替代不了人的检索,要善用工具。 GitHub和官网确实很有用,刚刚我在官网上也找到了相关文献,但是不理解。 ```html If you’d prefer to use the version of `libsodium` provided by your distribution, you can disable the bundled copy during install by running: SODIUM_INSTALL=system pip install pynacl ``` © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏