【问题标题】:Error while trying to install pycurl in Synology NAS尝试在 Synology NAS 中安装 pycurl 时出错
【发布时间】:2017-10-10 13:26:56
【问题描述】:

我使用的是群晖NAS和python(安装了2.7、3.5)

当我尝试通过 PIP 安装时,遇到此错误消息。

(第一次遇到 curl-config not found 错误。 但是现在有了几个entware包,我遇到了下面的消息)

----------

python3 -m pip install pycurl
Collecting pycurl
  Using cached pycurl-7.43.0.tar.gz
Building wheels for collected packages: pycurl
  Running setup.py bdist_wheel for pycurl ... error
  Complete output from command /usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-79dqoc3v/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpa8e0oiyqpip-wheel- --python-tag cp35:
  Using curl-config (libcurl 7.55.0)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/curl
  copying python/curl/__init__.py -> build/lib.linux-x86_64-3.5/curl
  running build_ext
  building 'pycurl' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/src
  /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_X86_64 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DPYCURL_VERSION="7.43.0" -DHAVE_CURL_SSL=1 -I/opt/include -I/volume1/@appstore/py3k/usr/local/include/python3.5m -c src/docstrings.c -o build/temp.linux-x86_64-3.5/src/docstrings.o
  unable to execute '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc': No such file or directory
  error: command '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pycurl
  Running setup.py clean for pycurl
Failed to build pycurl
Installing collected packages: pycurl
  Running setup.py install for pycurl ... error
    Complete output from command /usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-79dqoc3v/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-q_rurvzr-record/install-record.txt --single-version-externally-managed --compile:
    Using curl-config (libcurl 7.55.0)
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/curl
    copying python/curl/__init__.py -> build/lib.linux-x86_64-3.5/curl
    running build_ext
    building 'pycurl' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/src
    /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_X86_64 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DPYCURL_VERSION="7.43.0" -DHAVE_CURL_SSL=1 -I/opt/include -I/volume1/@appstore/py3k/usr/local/include/python3.5m -c src/docstrings.c -o build/temp.linux-x86_64-3.5/src/docstrings.o
    unable to execute '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc': No such file or directory
    error: command '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-79dqoc3v/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-q_rurvzr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-79dqoc3v/pycurl/

【问题讨论】:

  • 尝试使用来自here的.whl 文件进行安装
  • 我已经尝试过使用 .whl 文件,但它也显示如下错误
    wheel.tool.WheelError: pycurl-7.43.0-cp35-none-win32.whl is not compatible with this Python。 --force 无论如何都要安装。 (我用的是python3.5)
  • 我也尝试过你的建议(pycurl-7.43.0-cp35-cp35m-win32.whl),但它也不起作用
  • 如果我使用'force'选项,没有响应
  • 确保为您的系统下载正确的 .whl 文件。你有 32 位还是 64 位 Python?此外,您的 PC 上有 2 个不同的 Python 版本,因此请确保 pip 正在尝试为正确版本的 Python 安装 pycurl

标签: python python-3.x pycurl synology


【解决方案1】:

Synology DS415+ 我也遇到了这个问题。唯一的区别是我尝试安装netdisco。 我发现提前将CC环境变量设置为gcc编译器的实际位置有帮助

#export CC=/opt/bin/gcc

【讨论】: