-2

我想从 GitHub 安装一个使用 Cython 的包(https://github.com/mlysy/kalmantv)。我在本地克隆了该软件包,并尝试使用 安装它后pip install .,出现以下错误:

DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Processing /Users/me/Downloads/kalmantv
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk
       cwd: /Users/me/Downloads/kalmantv
  Complete output (6 lines):
  running egg_info
  writing kalmantv.egg-info/PKG-INFO
  writing dependency_links to kalmantv.egg-info/dependency_links.txt
  writing requirements to kalmantv.egg-info/requires.txt
  writing top-level names to kalmantv.egg-info/top_level.txt
  error: package directory 'eigen-3.3.7' does not exist
  ----------------------------------------
WARNING: Discarding file:///Users/me/Downloads/kalmantv. Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.
ERROR: Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.

我尝试--use-feature=in-tree-build从弃用警告中添加,但仍然收到错误(没有初始警告)。

我看到了许多建议,例如 using pip install --upgrade pip setuptools wheel,但没有任何效果。我猜这有一个简单的解决方法,但是这东西有点过头了,我不想破坏其他任何东西。

我需要做什么才能安全地纠正这个问题而不引起其他问题?

4

1 回答 1

0

setup.py文件有以下几行:

# path to eigen library
EIGEN_PATH = r"eigen-3.3.7"

奇怪的是,似乎期望 Eigen 头库出现在该位置。brew install eigen您可以使用或安装库sudo apt install libeigen3-dev。请注意,这可能不会安装项目期望的库的 3.3.7 版本。我不知道使用更新的版本是否会导致任何问题。

如果要安装 3.3.7 版,可以按照以下说明使用以下链接从源代码构建和安装它:

https://gitlab.com/libeigen/eigen/-/releases/3.3.7

完成后,切换到项目目录,并创建一个指向 Eigen 库的符号链接:

如果使用 brew 安装:ln -s /usr/local/Cellar/eigen/*/include/eigen3 eigen-3.3.7

如果使用 apt 安装:ln -s /usr/include/eigen3 eigen-3.3.7

如果从源安装:/usr/local/include/eigen3 eigen-3.3.7

一旦 Eigen 库安装并在 中可用./eigen-3.3.7pip install .应该可以工作,但为了更好的措施,您应该首先运行以下命令:

pip install -U pip setuptools wheel; pip install -U cython

请参阅Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace if you run into an error like: error: no member named 'signbit' in the global namespace

于 2021-08-21T04:48:17.127 回答