Repository: spyder-ide/spyder

Issue:
Spyder crashes at startup because of errors when importing Sympy
Hello everybody,
If I'm trying to start Spyder it always crashes and shows the attached error. It worked fine for weeks, I have no idea what it is about.
I did the reset and deleted the spyder.lock and updated spyder.
Could you please help?

## Versions and main components

* Spyder Version: 3.0.2
* Python Version: 3.5.2
* Operating system: Windows 7


Thanks in advance
Tinka
![spyder](https://cloud.githubusercontent.com/assets/22595315/20599290/9ea6b09a-b24d-11e6-8009-9ca0cbdbc7cf.PNG)




Discussion:
I have got the same error here after upgrading to spyder3, the crash-log is as below:

Traceback (most recent call last):
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 3001, in main
mainwindow = run_spyder(app, options, args)
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 2905, in run_spyder
main.setup()
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 1010, in setup
from xy.config import DOC_PATH as xy_doc_path
File "c:\python27\lib\site-packages\xy\config.py", line 40, in 
CONF = UserConfig('xy', defaults=DEFAULTS, version=version, subfolder='.xy')
File "c:\python27\lib\site-packages\xy\userconfig.py", line 110, in init
if version != self.get_version(version):
File "c:\python27\lib\site-packages\xy\userconfig.py", line 130, in get_version
return self.get(self.DEFAULT_SECTION_NAME, 'version', version)
File "c:\python27\lib\site-packages\xy\userconfig.py", line 269, in get
value = cp.ConfigParser.get(self, section, option, raw=self.raw)
File "c:\python27\lib\site-packages\backports\configparser_init_.py", line 811, in get
d)
File "c:\python27\lib\site-packages\backports\configparser_init_.py", line 384, in before_get
self.interpolate_some(parser, option, L, value, section, defaults, 1)
File "c:\python27\lib\site-packages\backports\configparser_init.py", line 397, in _interpolate_some
rawval = parser.get(section, option, raw=True, fallback=rest)
**TypeError: get() got an unexpected keyword argument 'raw'** 

I searched around for a fix, but had no luck :(


@Tuzi12, as you reported in Anaconda issues, this is an issue with PythonXY and not with Spyder itself. Since PythonXY seems unmaintained, we recommend you to use WinPython or Anaconda.

@TheTinka, please open a terminal (i.e. cmd.exe), run this command

    spyder --reset

and report the error is printed there.
@ccordoba12  Thanks for your reply and closed the other thread I opened. 

But do I need to install WinPython or Anaconda first for spyder to work again?

You need to uninstall PythonXY and install either WinPython or Anaconda. Both are Python scientific distributions, meaning that they come with Python and a lot of other scientific libraries and applications (including Spyder and all its dependencies).

WinPython is more similar to PythonXY than Anaconda, although is more focused on Python 3 than 2.
@ccordoba12  Thank you for the suggestion.

One more thing, if I uninstall PythonXY, will the Python27 comes with it uninstall as well? Since I have got some py files written in Python2, I want to make sure that I can run these files without much changes to make.
When I did the reset there is no error-message. Then Spyder is starting and shows the message from below.
@TheTinka, there has to be some error in the terminal where you started Spyder, else that window wouldn't appear.

@Tuzi12, then you need to install Anaconda because it has very good support for Python 2 and 3.
Some hint what kind of error? I am using Anaconda and installed spyder that way to.
The reset is looking like:
![spyder](https://cloud.githubusercontent.com/assets/22595315/20601657/0440e356-b25a-11e6-99ac-d12911be13a2.PNG)


So sorry, my bad. The command is

    spyder --show-console
![spyder](https://cloud.githubusercontent.com/assets/22595315/20601816/c28af568-b25a-11e6-9a27-d3a6177356bf.PNG)

It seems you have an old version of sympy. Please run

     conda update sympy

and try again

El 24/11/16 a las 09:29, TheTinka escribió:
>
> spyder 
> <https://cloud.githubusercontent.com/assets/22595315/20601816/c28af568-b25a-11e6-9a27-d3a6177356bf.PNG>
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub 
> <https://github.com/spyder-ide/spyder/issues/3738#issuecomment-262788724>, 
> or mute the thread 
> <https://github.com/notifications/unsubscribe-auth/AAWS7TvVbQv6EUFgZZeqnhZcRdwf7kBjks5rBZ8_gaJpZM4K7n42>.
>


You definitly saved my week. It works fine.
Thanks a lot.
Great!

Resolving patch:
diff --git a/spyder/utils/programs.py b/spyder/utils/programs.py
--- a/spyder/utils/programs.py
+++ b/spyder/utils/programs.py
@@ -436,7 +436,7 @@ def is_module_installed(module_name, version=None, installed_version=None,
         if installed_version is None:
             try:
                 actver = get_module_version(module_name)
-            except ImportError:
+            except:
                 # Module is not installed
                 return False
         else:


Test patch: