报错
Building wheels for collected packages: jsonnet
Building wheel for jsonnet (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /opt/conda/envs/spanrel/bin/python -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-wui0ge_u/jsonnet_b3e6a8453ce54896b5c962b87a81d432/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-wui0ge_u/jsonnet_b3e6a8453ce54896b5c962b87a81d432/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ bdist_wheel -d /tmp/pip-wheel-cnhrx_wr
cwd: /tmp/pip-install-wui0ge_u/jsonnet_b3e6a8453ce54896b5c962b87a81d432/
Complete output (4 lines):
running bdist_wheel
running build
running build_ext
error: [Errno 2] No such file or directory: ‘make’: ‘make’
ERROR: Failed building wheel for jsonnet
Running setup.py clean for jsonnet
Failed to build jsonnet
Installing collected packages: jsonnet, h5py, gevent, ftfy, flask-cors, flaky, editdistance, conllu, awscli, allennlp
Running setup.py install for jsonnet … error
ERROR: Command errored out with exit status 1:
command: /opt/conda/envs/spanrel/bin/python -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-wui0ge_u/jsonnet_b3e6a8453ce54896b5c962b87a81d432/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-wui0ge_u/jsonnet_b3e6a8453ce54896b5c962b87a81d432/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’“‘))’ install --record /tmp/pip-record-di28z1f7/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/envs/spanrel/include/python3.6m/jsonnet
cwd: /tmp/pip-install-wui0ge_u/jsonnet_b3e6a8453ce54896b5c962b87a81d432/
Complete output (4 lines):
running install
running build
running build_ext
error: [Errno 2] No such file or directory: ‘make’: ‘make’
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/conda/envs/spanrel/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '”‘"’/tmp/pip-install-wui0ge_u/jsonnet_b3e6a8453ce54896b5c962b87a81d432/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-wui0ge_u/jsonnet_b3e6a8453ce54896b5c962b87a81d432/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ install --record /tmp/pip-record-di28z1f7/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/envs/spanrel/include/python3.6m/jsonnet Check the logs for full command output.
1、确保是否正确安装了构建依赖项,比如 C 编译器和相关的开发库。
在不同的操作系统上可能有不同的方法。例如,在 Ubuntu 上,您可以运行以下命令安装构建工具链
sudo apt-get update
sudo apt-get install build-essential
对于其他操作系统,请查阅相应的文档来安装所需的构建工具。
2、检查是否已经安装了相关的依赖项
缺少了 jsonnet 包的构建依赖项。可以尝试使用系统包管理器或 Python 包管理器来安装该依赖项。例如,对于 Ubuntu 系统,可以运行以下命令:
sudo apt-get install libjsonnet-dev
对于使用 pip 来安装的情况,可能需要先安装该依赖项的开发文件,再重新运行安装命令。
- 如果上述方法都没有解决问题,可以尝试使用预编译的二进制版本,而不是从源代码构建安装。对于某些包来说,可能会提供预编译的二进制分发版,可以选择使用。可以在包的官方文档或 GitHub 页面上查找预编译版本的说明。