自从我在我的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中的完整回溯是
# Sphinx version: 1.7.4
# Python version: 2.7.10 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.10
# Last messages:
# Loaded extensions:
Traceback (most recent call last):
File "/usr/local/Cellar/sphinx-doc/1.7.4/libexec/lib/python2.7/site-packages/sphinx/cmdline.py", line 303, in main
args.warningiserror, args.tags, args.verbosity, args.jobs)
File "/usr/local/Cellar/sphinx-doc/1.7.4/libexec/lib/python2.7/site-packages/sphinx/application.py", line 187, in __init__
self.setup_extension(extension)
File "/usr/local/Cellar/sphinx-doc/1.7.4/libexec/lib/python2.7/site-packages/sphinx/application.py", line 411, in setup_extension
self.registry.load_extension(self, extname)
File "/usr/local/Cellar/sphinx-doc/1.7.4/libexec/lib/python2.7/site-packages/sphinx/registry.py", line 315, in load_extension
mod = __import__(extname, None, None, ['setup'])
File "/usr/local/Cellar/sphinx-doc/1.7.4/libexec/lib/python2.7/site-packages/sphinx/builders/applehelp.py", line 20, in <module>
from sphinx.builders.html import StandaloneHTMLBuilder
File "/usr/local/Cellar/sphinx-doc/1.7.4/libexec/lib/python2.7/site-packages/sphinx/builders/html.py", line 39, in <module>
from sphinx.highlighting import PygmentsBridge
File "/usr/local/Cellar/sphinx-doc/1.7.4/libexec/lib/python2.7/site-packages/sphinx/highlighting.py", line 23, in <module>
from sphinx.ext import doctest
File "/usr/local/Cellar/sphinx-doc/1.7.4/libexec/lib/python2.7/site-packages/sphinx/ext/doctest.py", line 15, in <module>
import doctest
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'
答案 0 :(得分:0)
我现在找到一种解决这种情况的方法。但不幸的是,不知道究竟是什么原因。
我所做的是删除a
中与pdb相关的任何内容。反正我也不需要python调试器。之后通过brew重新安装python是好的
答案 1 :(得分:0)
对我来说,这是Apple命令行工具
➜ ~ 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。