Ways to invoke python and Spyder on OSX

前端 未结 8 1905
深忆病人
深忆病人 2020-12-07 10:00

I recently bought a MacBook and install Python on it via Anaconda. Here\'s the version information:

Python 2.7.6 |Anaconda 1.8.0 (x86_64)| (default, Nov 11 2         


        
8条回答
  •  生来不讨喜
    2020-12-07 10:54

    A very simple method not requiring use of Terminal is essentially to create a spyder.app package in Applications and copy the spyder exec file from Anaconda into this folder. Clicking on the package will run spyder as an app, and you can right-click the dock icon to keep it in the dock.

    Below are the step-by-step instructions.

    We first create the spyder.app folder in Applications:

    1. Open the Applications folder in Finder.

    2. Right-click and create "New Folder".

    3. Name the folder "spyder.app" and allow the .app extension.

    We then copy the exec spyder file:

    1. In a new Finder window, open your home folder (it should have a simple picture of a house as the icon). A shortcut is to press shift+command+H while Finder is open.

    2. Open the anaconda3 folder, and then open the folder named 'bin'.

    3. Locate the exec file named 'spyder', and right-click to copy the file.

    Note: if anaconda3 isn't installed in your home directory, just search for 'anaconda3' with exact filename matches in Finder and open the file.

    Paste the copied exec file into the spyder.app package:

    1. In the Finder window open to Applications, right-click the spyder.app created above and select "Show Package Contents".

    2. Right-click in the window and paste the exec file.

    Now, when you return to the Applications folder, double-click on the spyder.app package and spyder should run. Right-click the icon in the dock and select "Keep in Dock" to keep the app in the dock when not running. You can also create the icon for the app as indicated in 4 and 5 of the original answer.

提交回复
热议问题