Skip to main content
 首页 » 编程设计

python之在 mac 上为 python3 安装 spyder

2025年05月04日16dudu

我很沮丧。看来我不明白这个安装的一个非常基本的概念,也找不到答案。

正如标题所说,我想在我的 mac 上安装 spyder for python3。因为我无法通过点击一些地方找到任何简单的安装。

在 mac 上预装了 python 2.7,我已经安装了 python3,这非常简单。

因此,我开始通过在命令行中键入 sudo easy_install pip 安装 pip。然后就跟着介绍了this site这基本上是说输入 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,您可能想使用这些方法。

祝你好运!