brew установить python не удалось после установки pyenv - PullRequest
0 голосов
/ 09 мая 2018

С тех пор, как я установил pyenv на свой Mac для управления версиями Python.Что-то не так с моим варевом.Всякий раз, когда я что-то устанавливаю, зависит от python. Brew устанавливает python из исходного кода и завершается с ошибкой.Я пытаюсь установить python напрямую, но результат такой же

output:

➜  ~ 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.

Я не очень разбираюсь в Sphinx.Так почему же здесь выдается это исключение?

После удаления 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'

Ответы [ 2 ]

0 голосов
/ 07 ноября 2018

Для меня это были инструменты командной строки 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 и прохождения установки я могу успешно установить Python с помощью brew.

0 голосов
/ 10 мая 2018

Я как-то нашел способ обойти эту ситуацию сейчас. Но, к сожалению, понятия не имею, какова реальная причина.

Что я делаю, так это удаляю все, что похоже на pdb в /usr/local/lib/python2.7/site-packages. В любом случае мне не нужен отладчик Python. После этого переустановите Python от Brew в порядке

...