How to create a Spyder application bundle on macOS
Published:
Spyder is a powerful scientific computing environment for Python programming language. However, to invode Spyder on macOS, you would need to type:
spyder3
in command line. This would be a little inconvinent and it leaves a terminal open. I present a new way to create a Mac application bundle for Spyder which can be easily docked and invoked.
First, find out the path of your Spyder executable by running:
which spyder3
Create a Mac application bundle:
cd /Applications
mkdir -p spyder.app/Contents/MacOS
echo -e '#!/bin/bash'"\n your_spyder_executable_path $@" >> spyder.app/Contents/MacOS/spyder
chmod +x spyder.app/Contents/MacOS/spyder
Create a file named Info.plist in the Contents folder (at spyder.app/Contents/Info.plist) with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleExecutable</key>
<string>spyder</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>3.1.4</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3.1.4</string>
</dict>
</plist>
Download the Spyder logo here. Click on the Spyder app in Application folder, and press command+i. This will bring up the info. Open the icon image and press control+c, and then copy it to the logo by clicking the icon on top left corner and press control+v.
(Optional) To prevent the generic python rocket icon to appear besides the spyder icon, uncheck in spyder the option Tools -> Preferences -> iPython console -> Graphics -> Activate (matplotlib)
Thank you for reading!