Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Spyder as default Python

Tags:

I've recently installed Anaconda (using the default settings) on Windows 7. When I try to open a .py file by double-clicking it, I get the Open with... option. How can I set the default program as Spyder?

like image 297
Medulla Oblongata Avatar asked Jul 09 '14 00:07

Medulla Oblongata


Video Answer


2 Answers

This is a variation based on Jose's solution of creating a .bat file that eventually worked for me.

Create a spyder.bat file with the following content:

start C:\YourPath\Anaconda2\pythonw.exe C:\YourPath\Anaconda2\cwp.py C:\YourPath\Anaconda2 "C:/YourPath/Anaconda2/pythonw.exe" "C:/YourPath/Anaconda2/Scripts/spyder-script.py" %1

Change YourPath to your actual Anaconda path. Other solutions didn't work for me, and the code here is inspired by Spyder shortcut's target.

like image 143
xyzjayne Avatar answered Sep 16 '22 16:09

xyzjayne


You must create a spyder.bat file with the following content:

start C:\path\to\Anaconda3\pythonw C:\path\to\Anaconda3\Scripts\spyder-script.py  %1

Remember set the path where Anaconda is installed.
Then, use the Open with... dialog and select your new spyder.bat batch file.
It works on Windows 10 Home. I hope it works in Windows 7 too.

like image 26
Jose Raul Barreras Avatar answered Sep 17 '22 16:09

Jose Raul Barreras