安装pyen后,brew安装python失败

2024-06-25 23:25:51 发布

您现在位置:Python中文网/ 问答频道 /正文

自从我在mac上安装pyenv来管理python版本以来。我的啤酒出问题了。每当我安装依赖python的东西时,brew从源代码安装python,并异常失败。我尝试直接安装python,但结果是一样的

输出:

➜  ~ brew install python
Warning: Building python from source:
  The bottle needs the Apple Command Line Tools to be installed.
  You can install them, if desired, with:
    xcode-select --install

==> Downloading https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
Already downloaded: /Users/fengweizhou/Library/Caches/Homebrew/python-3.6.5.tar.xz
==> ./configure --prefix=/usr/local/Cellar/python/3.6.5 --enable-ipv6 --datarootd
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python/3.6.5
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python/3.6.5/shar
==> Downloading https://files.pythonhosted.org/packages/72/c2/c09362ab29338413ab6
Already downloaded: /Users/fengweizhou/Library/Caches/Homebrew/python--setuptools-39.0.1.zip
==> Downloading https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e
Already downloaded: /Users/fengweizhou/Library/Caches/Homebrew/python--pip-10.0.1.tar.gz
==> Downloading https://files.pythonhosted.org/packages/5d/c1/45947333669b31bc6b4
Already downloaded: /Users/fengweizhou/Library/Caches/Homebrew/python--wheel-0.31.0.tar.gz
==> make html
Last 15 lines from /Users/fengweizhou/Library/Logs/Homebrew/python/05.make:
html

mkdir -p build
Using existing Misc/NEWS file
PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -D latex_elements.papersize=  . build/html
Running Sphinx v1.7.4

Exception occurred:
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/doctest.py", line 355, in <module>
    class _OutputRedirectingPdb(pdb.Pdb):
AttributeError: 'module' object has no attribute 'Pdb'
The full traceback has been saved in /tmp/sphinx-err-0dDG9t.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [build] Error 2

READ THIS: https://docs.brew.sh/Troubleshooting

These open issues may also help:
Switch --with-python option for GDB formula to Python 3. https://github.com/Homebrew/homebrew-core/pull/24524
Change cookiecutter to depend on Python 3 https://github.com/Homebrew/homebrew-core/pull/27028
neovim: Add caveats for Python/Ruby support https://github.com/Homebrew/homebrew-core/pull/26869
libpeas: add support for running python plugins https://github.com/Homebrew/homebrew-core/pull/22430

Error: Your Xcode (9.2) is outdated.
Please update to Xcode 9.3 (or delete it).
Xcode can be updated from the App Store.

我对斯芬克斯的事不太了解。那么它为什么在这里抛出这个异常呢?在

卸载pyenv后,结果仍然相同。在

/tmp/sphinx-err-0dDG9t.log中的完整回溯是

^{pr2}$

Tags: installthetohttpsbuildgithubcommake
2条回答

对我来说,是苹果的命令行工具

➜  ~ brew install python
Warning: Building python from source:
  The bottle needs the Apple Command Line Tools to be installed.
  You can install them, if desired, with:
    xcode-select  install

运行xcode-select install并完成安装后,我可以使用brew成功地安装Python。在

我现在有点想办法解决这个问题。但不幸的是,不知道真正的原因是什么。在

我要做的是删除/usr/local/lib/python2.7/site-packages中与pdb相关的任何内容。反正我不需要python调试器。之后,重新安装python by brew就可以了

相关问题 更多 >