Repository: spyder-ide/spyder

Issue:
Spyder within Python 2.7 Anaconda environment crashes
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [x] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [x] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [x] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [ ] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [x] Tried basic troubleshooting (if a bug/error)
    * [x] Restarted Spyder
    * [x] Reset preferences with ``spyder --reset``
    * [x] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [x] Tried the other applicable steps from the Troubleshooting Guide
* [x] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description
Platform - HP Envy, 10th Gen Intel i7, Windows 10 Pro 1909 64-bit.

After from-scratch reinstall of Anaconda3 1.9.12 Navigator (in hopes of clearing the Spyder IDE issues), created a Python 2.7 virtual environment using Anaconda Cmd.exe (conda) prompt.  Installed both Spyder 4.1.4 (default) as well as rolled back to Spyder 3.2.8 and 3.2.3 (earliest I can go) - all have same behavior within the Python 2.7 virtual environment - Spyder fails to start and get the dialog box shown in the attachment below.

![Spyder_3 2 8Crash_Screenshot](https://user-images.githubusercontent.com/6884879/95688164-0df50380-0bd6-11eb-8510-8631e72df4f2.png)



From the base Python environment (Python 3.8.3) Spyder 4.1.4 (default version) can be successfully launched.

### What steps reproduce the problem?

1. Download and install latest Anaconda3 from https://www.anaconda.com/products/individual
2. Launch Navigator
3. Launch conda Cmd.exe
4. "conda create -n py2_7 python=2.7"
5. Exit Anaconda3 Navigator, then re-execute.
6. Switch to "py2_7" via "Applications on" pull-down within Navigator.
7. Install Spyder (tried default version 4.1.4, 3.2.8, and 3.2.3)
8. Launch Spyder (any of the versions mentioned in step 7) - get aforementioned dialog, i.e. "Spyder crashed during last session".

Things tried but issue still persists.
1. "spyder --reset".
2. Removal of non-base environments via "conda remove" in CMD.exe Prompt, then reinstalling Anaconda from scratch.
3. From CMD.exe Prompt, uninstall then reinstall Spyder ("conda uninstall" and "conda install".  Uninstall and re-install are without error, but Spyder still crashes.
4. After creating the "py2_7" environment, "conda activate py2_7" then run Spyder from command line.  Get traceback shown in traceback section.


### What is the expected output? What do you see instead?
I expect to see the Spyder IDE open.  What I see instead is either:
1. (execution from Navigator) Error dialog previously attached.
2. (execution from CMD.exe conda console) Traceback as shown below.


### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

Microsoft Windows [Version 10.0.18363.1082]
(c) 2019 Microsoft Corporation. All rights reserved.

(py2_7) C:\Users\micha>spyder --show-console
(Deprecated) --show console does nothing, now the default  behavior is to show the console, use --hide-console if you want to hide it
Traceback (most recent call last):
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\app\mainwindow.py", line 3208, in main
    mainwindow = run_spyder(app, options, args)
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\app\mainwindow.py", line 3082, in run_spyder
    main = MainWindow(options)
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\app\mainwindow.py", line 373, in __init__
    from spyder.plugins.shortcuts import ShortcutsConfigPage
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\plugins\shortcuts.py", line 835, in <module>
    class ShortcutsConfigPage(GeneralConfigPage):
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\plugins\shortcuts.py", line 839, in ShortcutsConfigPage
    ICON = ima.icon('keyboard')
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\utils\icon_manager.py", line 267, in icon
    directory=_resource['directory'])
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\qtawesome\__init__.py", line 178, in load_font
    return _instance().load_font(prefix, ttf_filename, charmap_filename, directory)
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\qtawesome\__init__.py", line 54, in _instance
    'materialdesignicons-webfont-charmap.json')
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\qtawesome\iconic_font.py", line 206, in __init__
    super().__init__()
TypeError: super() takes at least 1 argument (0 given)

(py2_7) C:\Users\micha>spyder --reset
*** Reset Spyder settings to defaults ***
removing: C:\Users\micha\.spyder\spyder.ini
removing: C:\Users\micha\.spyder\langconfig
removing: C:\Users\micha\.spyder\spyder.lock

(py2_7) C:\Users\micha>spyder --show-console
(Deprecated) --show console does nothing, now the default  behavior is to show the console, use --hide-console if you want to hide it
Traceback (most recent call last):
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\app\mainwindow.py", line 3208, in main
    mainwindow = run_spyder(app, options, args)
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\app\mainwindow.py", line 3082, in run_spyder
    main = MainWindow(options)
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\app\mainwindow.py", line 373, in __init__
    from spyder.plugins.shortcuts import ShortcutsConfigPage
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\plugins\shortcuts.py", line 835, in <module>
    class ShortcutsConfigPage(GeneralConfigPage):
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\plugins\shortcuts.py", line 839, in ShortcutsConfigPage
    ICON = ima.icon('keyboard')
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\spyder\utils\icon_manager.py", line 267, in icon
    directory=_resource['directory'])
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\qtawesome\__init__.py", line 178, in load_font
    return _instance().load_font(prefix, ttf_filename, charmap_filename, directory)
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\qtawesome\__init__.py", line 54, in _instance
    'materialdesignicons-webfont-charmap.json')
  File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\qtawesome\iconic_font.py", line 206, in __init__
    super().__init__()
TypeError: super() takes at least 1 argument (0 given)


```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 4.1.4, 3.2.8, 3.2.3
* Python version: 2.7.18
* Qt version: 
* PyQt version: 
* Operating System name/version: Windows 10 Pro x64 1909 

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
Spyder crashes in py2_7 environment so can't get to the Dependencies listing.
```



Discussion:
Hi @mfogle,

Spyder 4.1.4 doesn't support Python 2 anymore, we highly recommend to move all your code base to python 3 as python 2 lost support since December of last's year. If you still need to run code in python please check the thread in the issue #13510, hope this works for you! 
> File "C:\Users\micha\anaconda3\envs\py2_7\lib\site-packages\qtawesome\iconic_font.py", line 206, in __init__
    super().__init__()

Hey @mfogle, thanks for reporting. You need to install QtAwesome 0.7.3 to fix this error for now, but as @steff456 said, it's harder and harder for us to support Python 2. So please consider to move to Python 3 as soon as possible.
Thanks, @ccordoba12, for pointing out the QtAwesome 0.7.3 work around.  It allowed me to launch Spyder 4.0.1 under Python 2.  I am in the process of finally migrating over to Python 3 and much of my old code is not working (as one might expect), so it is helpful to go back and see how my code behaved under Python 2 before deciding on an approach to resolve a given issue in Python 3.
Sure, no problem. We'll release a last version (4.1.6) with this and all our other dependencies constrained for Python 2, so it can be used in the future.

It won't be possible to install it with conda because Anaconda doesn't create Python 2 packages anymore, but at least it'll be possible to install it with pip (after installing PyQt5 with conda).

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -201,39 +201,39 @@ def run(self):
     import setuptools     # analysis:ignore
 
 install_requires = [
-    'applaunchservices>=0.1.7;platform_system=="Darwin"',
-    'atomicwrites>=1.2.0',
-    'chardet>=2.0.0',
-    'cloudpickle>=0.5.0',
-    'diff-match-patch>=20181111',
-    'intervaltree',
+    'applaunchservices>=0.1.7,<1.0.0;platform_system=="Darwin"',
+    'atomicwrites>=1.2.0,<=1.4.0',
+    'chardet>=2.0.0,<=3.0.4',
+    'cloudpickle>=0.5.0,<=1.3.0',
+    'diff-match-patch==20181111',
+    'intervaltree<=3.1.0',
     'ipython>=4.0',
     'jedi==0.17.1',
     # Don't require keyring for Python 2 and Linux
     # because it depends on system packages
-    'keyring;sys_platform!="linux2"',
-    'nbconvert>=4.0',
-    'numpydoc>=0.6.0',
+    'keyring<21.2.0;sys_platform!="linux2"',
+    'nbconvert>=4.0,<6.0',
+    'numpydoc>=0.6.0,<1.0.0',
     # Required to get SSH connections to remote kernels
-    'paramiko>=2.4.0;platform_system=="Windows"',
+    'paramiko>=2.4.0,<2.8;platform_system=="Windows"',
     'parso==0.7.0',
-    'pexpect>=4.4.0',
-    'pickleshare>=0.4',
-    'psutil>=5.3',
-    'pygments>=2.0',
-    'pylint>=1.0',
+    'pexpect>=4.4.0,<4.9.0',
+    'pickleshare>=0.4,<0.8',
+    'psutil>=5.3,<5.8',
+    'pygments>=2.0,<=2.5.2',
+    'pylint>=1.0,<=1.9.5',
     'pyqt5<5.13;python_version>="3"',
     'pyqtwebengine<5.13;python_version>="3"',
     'python-language-server[all]>=0.34.0,<1.0.0',
-    'pyxdg>=0.26;platform_system=="Linux"',
-    'pyzmq>=17',
-    'qdarkstyle>=2.8',
-    'qtawesome>=0.5.7',
-    'qtconsole>=4.6.0',
-    'qtpy>=1.5.0',
-    'sphinx>=0.6.6',
+    'pyxdg>=0.26,<=0.27;platform_system=="Linux"',
+    'pyzmq>=17,<20',
+    'qdarkstyle>=2.8,<2.9',
+    'qtawesome>=0.5.7,<1.0.0',
+    'qtconsole>=4.6.0,<5.0.0',
+    'qtpy>=1.5.0,<2.0.0',
+    'sphinx>=0.6.6,<=1.8.5',
     'spyder-kernels>=1.9.4,<1.10.0',
-    'watchdog',
+    'watchdog==0.10.3',
 ]
 
 extras_require = {
diff --git a/spyder/__init__.py b/spyder/__init__.py
--- a/spyder/__init__.py
+++ b/spyder/__init__.py
@@ -29,7 +29,7 @@
 OTHER DEALINGS IN THE SOFTWARE.
 """
 
-version_info = (4, 1, 5)
+version_info = (4, 1, 6, "dev0")
 
 __version__ = '.'.join(map(str, version_info))
 __license__ = __doc__
diff --git a/spyder/preferences/shortcuts.py b/spyder/preferences/shortcuts.py
--- a/spyder/preferences/shortcuts.py
+++ b/spyder/preferences/shortcuts.py
@@ -915,7 +915,7 @@ class ShortcutsSortFilterProxy(QSortFilterProxyModel):
 
     def __init__(self, parent=None):
         """Initialize the multiple sort filter proxy."""
-        super().__init__(parent)
+        super(ShortcutsSortFilterProxy, self).__init__(parent)
         self._parent = parent
         self.pattern = re.compile(r'')
         self.filters = {}


Test patch:
diff --git a/spyder/tests/test_dependencies_in_sync.py b/spyder/tests/test_dependencies_in_sync.py
--- a/spyder/tests/test_dependencies_in_sync.py
+++ b/spyder/tests/test_dependencies_in_sync.py
@@ -218,6 +218,7 @@ def test_dependencies_for_binder_in_sync():
     assert spyder_env == full_reqs
 
 
+@pytest.mark.skip
 def test_dependencies_for_spyder_dialog_in_sync():
     """
     Spyder dependencies dialog should share deps with conda.txt.