简体   繁体   中英

Installing spyder for python3 on mac

I am very frustrated. It seems I don't understand a very basic concept of this installing and can't find an answer.

As the title says I want to install spyder for python3 on my mac. Since I couldn't find any easy installation just by clicking some where.

On mac python 2.7 is preinstalled and I already installed python3 which was pretty easy.

So I started by installing pip by typing sudo easy_install pip in the command line. Then I followed the introduction of this site which basically says to type pip install -U spyder which led to an error at the end. I realized that I have to use pip3 because I have two python versions. Why is this nowhere mentioned?! Anyway this worked -- at least it didn't trigger an error. However, now I am confused where is the application? How can I use spyder now?

Any help is appreciated.

edit As I changed into to folder bin suddenly the terminal responded to spyder3 But the result was

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

Nathanael,

It sounds as though you've done the right thing, but you've done something else too.

pip3 install spyder # Installs Spyder for python 3

If you want to know where the Spyder app is, use the which command.

which spyder3 # This will give you the path to the application file.

If you want to use Spyder, enter spyder3 followed by the file you'd like to edit.

spyder3 myfilename.py # Opens (creates if needed) myfilename.py in Spyder.

Depending on how deep your trouble is, you may want to just re-install Spyder, or you will likley want to clean up your python3 install with something like Homebrew on your mac.

As you'll read on Github , Anaconda recently stopped financially supporting Spyder and they list some alternate installation methods which you may want to use if you're not going to use Anaconda or PIP.

Best of luck!

( Spyder developer here )

So I started by installing pip by typing sudo easy_install pip in the command line.

Please avoid this route entirely. You should never, ever install things into your system Python (especially in macOS) because you can risk to break your system entirely. That's because Python is used by the operating system to run certain things, so it's better to leave it alone.

The simplest way to install Spyder in macOS is to download Anaconda and install it. Anaconda comes with all Spyder dependencies and also with the most important scientific Python libraries ready to be used.

Other options are Homebrew or MacPorts, but Anaconda is really the easiest one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM