无法在pyenv virtualenv中安装lektor:这些(其他)Python版本中存在`clang'

问题描述 投票:1回答:1

我正在尝试使用lektorpyenv virtualenv安装到一个新的virtualenv中。我用Python 3.7.0创建一个新的virtualenv没有问题,但是当我尝试使用pip install lektor时,我遇到了watchdog的构建失败并出现以下错误消息:

pyenv: clang: command not found

The `clang' command exists in these Python versions:
  anaconda3-5.0.0

error: command 'clang' failed with exit status 127

我知道anaconda3版本有clang,但我也在/usr/bin安装了一个版本。 which -a clang的输出是:

$PYENV_ROOT/shims/clang
/usr/bin/clang

我可以手动设置垫片指向usr/bin吗?或者这个问题有不同的解决方案吗?

pip clang pyenv python-watchdog
1个回答
0
投票

这是一个腐烂的解决方案,但确实有效。通过拾取垫片并暂时移动它(例如,mv $PYENV_ROOT/shims/clang ~/Desktop),可以安装watchdog,然后可以将clang垫片移回原始位置。如果垫片不指向给定环境中的任何位置,则更好的选择是pyenv默认为系统版本的程序...

Alternative solution

pyenv插件pyenv-which-ext通过在看到它们在当前环境中不存在之后检查正常$PATH中的实用程序的存在来处理这类问题。这是通过Homebrew快速安装,照顾我的所有问题。

© www.soinside.com 2019 - 2024. All rights reserved.