Recover default python path

728 views
Skip to first unread message

Andrey Mostovov

unread,
Mar 28, 2014, 7:31:13 AM3/28/14
to spyd...@googlegroups.com
Hi,

I unintentionally modified the default python path to a wrong one in the Preferences window of Spyder. After restarting it, the following error message showed up:

A Python or IPython Console failed to start!

and the python console was indeed disabled.

When trying to open the Preferences window in order to correct the python path, I get an error message in the Internal Console:

>>> Traceback (most recent call last):

  File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/spyder.py", line 1853, in edit_preferences

    widget = plugin.create_configwidget(dlg)

  File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/plugins/__init__.py", line 179, in create_configwidget

    configwidget.initialize()

  File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/plugins/externalconsole.py", line 67, in initialize

    PluginConfigPage.initialize(self)

  File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/plugins/configdialog.py", line 49, in initialize

    self.setup_page()

  File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/plugins/externalconsole.py", line 307, in setup_page

    interpreter=interpreter)

  File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/utils/programs.py", line 251, in is_module_installed

    stdout=subprocess.PIPE).communicate()[0]

  File "subprocess.pyc", line 711, in __init__

  File "subprocess.pyc", line 1308, in _execute_child

OSError: [Errno 2] No such file or directory


I am not an advanced user so I do not see how to deal with this issue, I hope this is the right place to ask such questions.


Details: Mac OS 10.6.8, Spyder 2.2.5 (installed from dmg)


Thanks!


Andrey


Adrian Klaver

unread,
Mar 28, 2014, 12:56:06 PM3/28/14
to spyd...@googlegroups.com
On 03/28/2014 04:31 AM, Andrey Mostovov wrote:
> Hi,
>
> I unintentionally modified the default python path to a wrong one in the
> Preferences window of Spyder. After restarting it, the following error
> message showed up:

I am going to assume you mean the PYTHONSTARTUP setting in the console
preferences. If that is not the case you are going to have to be more
specific.

>
> A Python or IPython Console failed to start!
>
> and the python console was indeed disabled.
>
> When trying to open the Preferences window in order to correct the
> python path, I get an error message in the Internal Console:
>

>
> I am not an advanced user so I do not see how to deal with this issue, I
> hope this is the right place to ask such questions.

In your home directory find the .spyder2 directory. Look for the
spyder.ini field. In that file search for:

pythonstartup/default

It is probably set to False. Set to True:

pythonstartup/default = True


Restart Spyder

If that does not work then you have two options:

1) From the command line run spyder --defaults. This resets the
configuration settings to their defaults. This means any other
customizations you have done will also be lost.

2) Uninstall and then reinstall Spyder. Again you will be starting over.


>
>
> Details: Mac OS 10.6.8, Spyder 2.2.5 (installed from dmg)
>
>
> Thanks!
>
>
> Andrey
>


--
Adrian Klaver
adrian...@gmail.com

Andrey Mostovov

unread,
Apr 1, 2014, 1:19:48 PM4/1/14
to spyd...@googlegroups.com
Thanks! That worked!

I was looking everywhere for spyder initialization file. Unfortunately the folder you've mentioned is hidden in the standard configuration of Mac OS, so I probably wouldn't find the file without your help.

пятница, 28 марта 2014 г., 12:31:13 UTC+1 пользователь Andrey Mostovov написал:

Andrey Mostovov

unread,
Apr 1, 2014, 1:28:46 PM4/1/14
to spyd...@googlegroups.com
By the way, it would probably be useful to "secure" spyder from such situation, because if it has a wrong path to python interpreter it becomes totally disabled and you can not repair this without externally modifying ini file. Reinstallation didn't help by the way (the ini file remains the same after reinstallation)
Thanks!

Andrey

пятница, 28 марта 2014 г., 17:56:06 UTC+1 пользователь Adrian Klaver написал:

Martin Durant

unread,
Apr 2, 2014, 10:47:57 AM4/2/14
to spyd...@googlegroups.com
In a terminal you can type

> which python
or
> where python

Be warned, however, that on Mac OS, this might give you the system default python rather than the setup which spyder uses (the latter command above should list all possibilities). Depending on how you installed python/spyder, it could be in a number of locations; generally if you can run spyder from the terminal, then you probably will find the correct python.

Adrian Klaver

unread,
Apr 2, 2014, 11:58:13 AM4/2/14
to spyd...@googlegroups.com
On 04/01/2014 10:19 AM, Andrey Mostovov wrote:
> Thanks! That worked!

For future reference, what worked?

pythonstartup/default = True

or

From the command line run spyder --defaults.

>
> I was looking everywhere for spyder initialization file. Unfortunately
> the folder you've mentioned is hidden in the standard configuration of
> Mac OS, so I probably wouldn't find the file without your help.
>



--
Adrian Klaver
adrian...@aklaver.com

Andrey Mostovov

unread,
Apr 18, 2014, 8:09:31 AM4/18/14
to spyd...@googlegroups.com
Sorry, what helped is changing pythonstartup/default from False to True (pythonstartup/default = True) in spyder.ini file.

среда, 2 апреля 2014 г., 17:58:13 UTC+2 пользователь Adrian Klaver написал:

Snehal Salaskar

unread,
Jan 19, 2016, 2:16:30 PM1/19/16
to spyder, adrian...@gmail.com


On Friday, March 28, 2014 at 10:26:06 PM UTC+5:30, Adrian Klaver wrote:
On 03/28/2014 04:31 AM, Andrey Mostovov wrote:
> Hi,
>
> I unintentionally modified the default python path to a wrong one in the
> Preferences window of Spyder. After restarting it, the following error
> message showed up:

I am going to assume you mean the PYTHONSTARTUP setting in the console
preferences. If that is not the case you are going to have to be more
specific.

>
> A Python or IPython Console failed to start!
>
> and the python console was indeed disabled.
>
> When trying to open the Preferences window in order to correct the
> python path, I get an error message in the Internal Console:
>

>
> I am not an advanced user so I do not see how to deal with this issue, I
> hope this is the right place to ask such questions.

In your home directory find the .spyder2 directory. Look for the
spyder.ini field. In that file search for:

pythonstartup/default

It is probably set to False. Set to True:

pythonstartup/default = True
I am getting the same error and i did what was mentioned over here to change the pythonstartup/default field but that field is already true andd it is still giving an error
Please help i am not getting what to do 
even the command line thing is not working
Reply all
Reply to author
Forward
0 new messages