[英]Installing spyder for python3 on mac
我很沮喪。 看來我不了解此安裝的基本概念,也找不到答案。
如標題所示,我想在Mac上安裝適用於python3的spyder。 由於我僅單擊某些位置就找不到任何簡單的安裝。
在Mac上預裝了python 2.7,我已經安裝了python3,這非常簡單。
因此,我首先在命令行中輸入sudo easy_install pip
來安裝pip
。 然后,我跟隨該站點的介紹, 該站點基本上說要鍵入pip install -U spyder
,最后導致錯誤。 我意識到我必須使用pip3
因為我有兩個python版本。 為什么這里沒有提到? 無論如何,這行之有效-至少它沒有觸發錯誤。 但是,現在我很困惑,應用程序在哪里? 我現在如何使用spyder?
任何幫助表示贊賞。
編輯當我突然變成文件夾bin時,終端響應了spyder3
但結果是
Nathanaels-iMac:bin nathanaelskrepek$ spyder3
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/qtpy/__init__.py", line 148, in <module>
from PySide import __version__ as PYSIDE_VERSION # analysis:ignore
ModuleNotFoundError: No module named 'PySide'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/spyder3", line 11, in <module>
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/spyder/app/start.py", line 144, in main
from spyder.app import mainwindow
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 49, in <module>
requirements.check_qt()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/spyder/requirements.py", line 39, in check_qt
import qtpy
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/qtpy/__init__.py", line 154, in <module>
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found
拿但業
聽起來好像您做對了事情,但您也做了其他事情。
pip3 install spyder # Installs Spyder for python 3
如果您想知道Spyder應用程序在哪里,請使用which命令。
which spyder3 # This will give you the path to the application file.
如果要使用Spyder,請輸入spyder3,然后輸入要編輯的文件。
spyder3 myfilename.py # Opens (creates if needed) myfilename.py in Spyder.
根據問題的嚴重程度,您可能只想重新安裝Spyder,或者您可能會想在Mac上使用Homebrew之類的工具清理python3安裝。
正如您在Github上閱讀的那樣,Anaconda最近停止了對Spyder的財務支持,並且列出了一些其他安裝方法,如果您不打算使用Anaconda或PIP,可能要使用這些方法。
祝你好運!
( 這里是Spyder開發人員 )
因此,我首先在命令行中輸入sudo easy_install pip來安裝pip。
請完全避免使用此路線。 永遠不要將任何東西安裝到系統Python中(尤其是在macOS中),因為您可能會冒險完全破壞系統。 那是因為操作系統使用Python運行某些東西,所以最好不要使用它。
在macOS中安裝Spyder的最簡單方法是下載Anaconda並安裝它。 Anaconda附帶了所有Spyder依賴項,以及最重要的科學Python庫可供使用。
其他選項是Homebrew或MacPorts,但Anaconda確實是最簡單的選項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.