Spyder: Spyder shows blank screen because of errors in QtAwesome

Created on 15 Dec 2016  路  72Comments  路  Source: spyder-ide/spyder

Running Windows 10 on a 64 Bit machine.

Steps:

  1. 陌nstall Anaconda (Anaconda3-4.2.0-Windows-x86_64.exe)
  2. Launch Spyder 3.0.0 within Anaconda Navigator

_Note: At the very beginning -first time- spyder started succesfully. i could even install python modules and compiled a piece of code. After first restart of machine, problems started to occur as i mentioned below_

Results:

  • Spyder crashes with lots of qt log in console.
  • Spyder icon in Anaconda navigator also crashes.

spyder --show-console

Font is empty
Font is empty
Font is empty
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QWindowsWindow::setGeometry: Unable to set geometry 1260x1442+18+41 on QWidgetWindow/'MainWindowClassWindow'. Resulting geometry:  1260x1061+18+41 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 418x716, maximum size: 16777215x16777215).
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states

It looks like a qt related thing. I searched existing issues and already tried:
conda update qt pyqt

pyqt                      5.6.0                    py35_1
qt                        5.6.2                    vc14_0  [vc14]

python
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32

ipython qtconsole (works fine)
python spyder --reset
python spyder --new_instance (same crash)

At last, i updated spyder to 3.0.2 but nothing changes.

I installed Anaconda (after uninstalling carefully -with anaconda clean-) at least 5 times. https://docs.continuum.io/anaconda/install

_Last edit before any comment_
_I'm able to run spyder (via anaconda) succefully on another windows 7 pc (64 bit) for a long time. The difference is: i installed theano and keras libraries on this mentioned machine after first installation and able to run codes from these libs succesfully till first shut down of machine._

Tried below solution and get spyder work at one time but without any icon in IDE:
conda install qt=4.8.7=vc10_4 ( as mentioned here https://github.com/spyder-ide/spyder/issues/2858)

Dependencies

#
_license                  1.1                      py35_1
_nb_ext_conf              0.3.0                    py35_0
alabaster                 0.7.9                    py35_0
anaconda                  4.2.0               np111py35_0
anaconda-clean            1.0.0                    py35_0
anaconda-client           1.5.1                    py35_0
anaconda-navigator        1.3.1                    py35_0
argcomplete               1.0.0                    py35_1
astroid                   1.4.7                    py35_0
astropy                   1.2.1               np111py35_0
babel                     2.3.4                    py35_0
backports                 1.0                      py35_0
beautifulsoup4            4.5.1                    py35_0
bitarray                  0.8.1                    py35_1
blaze                     0.10.1                   py35_0
bokeh                     0.12.2                   py35_0
boto                      2.42.0                   py35_0
bottleneck                1.1.0               np111py35_0
bzip2                     1.0.6                    vc14_3  [vc14]
certifi                   2016.2.28                py35_0
cffi                      1.7.0                    py35_0
chest                     0.2.3                    py35_0
click                     6.6                      py35_0
cloudpickle               0.2.1                    py35_0
clyent                    1.2.2                    py35_0
colorama                  0.3.7                    py35_0
comtypes                  1.1.2                    py35_0
conda                     4.2.13                   py35_0
conda-build               2.0.2                    py35_0
conda-env                 2.6.0                         0
configobj                 5.0.6                    py35_0
console_shortcut          0.1.1                    py35_1
contextlib2               0.5.3                    py35_0
cryptography              1.6                      py35_0
curl                      7.49.0                   vc14_0  [vc14]
cycler                    0.10.0                   py35_0
cython                    0.24.1                   py35_0
cytoolz                   0.8.0                    py35_0
dask                      0.11.0                   py35_0
datashape                 0.5.2                    py35_0
decorator                 4.0.10                   py35_0
dill                      0.2.5                    py35_0
docutils                  0.12                     py35_2
dynd-python               0.7.2                    py35_0
entrypoints               0.2.2                    py35_0
et_xmlfile                1.0.1                    py35_0
fastcache                 1.0.2                    py35_1
filelock                  2.0.6                    py35_0
flask                     0.11.1                   py35_0
flask-cors                2.1.2                    py35_0
freetype                  2.5.5                    vc14_1  [vc14]
get_terminal_size         1.0.0                    py35_0
gevent                    1.1.2                    py35_0
greenlet                  0.4.10                   py35_0
h5py                      2.6.0               np111py35_2
hdf5                      1.8.15.1                 vc14_4  [vc14]
heapdict                  1.0.0                    py35_1
icu                       57.1                     vc14_0  [vc14]
idna                      2.1                      py35_0
imagesize                 0.7.1                    py35_0
ipykernel                 4.5.0                    py35_0
ipython                   5.1.0                    py35_0
ipython_genutils          0.1.0                    py35_0
ipywidgets                5.2.2                    py35_0
itsdangerous              0.24                     py35_0
jdcal                     1.2                      py35_1
jedi                      0.9.0                    py35_1
jinja2                    2.8                      py35_1
jpeg                      8d                       vc14_2  [vc14]
jsonschema                2.5.1                    py35_0
jupyter                   1.0.0                    py35_3
jupyter_client            4.4.0                    py35_0
jupyter_console           5.0.0                    py35_0
jupyter_core              4.2.0                    py35_0
lazy-object-proxy         1.2.1                    py35_0
libdynd                   0.7.2                         0
libpng                    1.6.22                   vc14_0  [vc14]
libtiff                   4.0.6                    vc14_2  [vc14]
llvmlite                  0.13.0                   py35_0
locket                    0.2.0                    py35_1
lxml                      3.6.4                    py35_0
markupsafe                0.23                     py35_2
matplotlib                1.5.3               np111py35_0
menuinst                  1.4.1                    py35_0
mistune                   0.7.3                    py35_0
mkl                       11.3.3                        1
mkl-service               1.1.2                    py35_2
mpmath                    0.19                     py35_1
multipledispatch          0.4.8                    py35_0
nb_anacondacloud          1.2.0                    py35_0
nb_conda                  2.0.0                    py35_0
nb_conda_kernels          2.0.0                    py35_0
nbconvert                 4.2.0                    py35_0
nbformat                  4.1.0                    py35_0
nbpresent                 3.0.2                    py35_0
networkx                  1.11                     py35_0
nltk                      3.2.1                    py35_0
nose                      1.3.7                    py35_1
notebook                  4.2.3                    py35_0
numba                     0.28.1              np111py35_0
numexpr                   2.6.1               np111py35_0
numpy                     1.11.1                   py35_1
odo                       0.5.0                    py35_1
openpyxl                  2.3.2                    py35_0
openssl                   1.0.2j                   vc14_0  [vc14]
pandas                    0.18.1              np111py35_0
partd                     0.3.6                    py35_0
path.py                   8.2.1                    py35_0
pathlib2                  2.1.0                    py35_0
patsy                     0.4.1                    py35_0
pep8                      1.7.0                    py35_0
pickleshare               0.7.4                    py35_0
pillow                    3.3.1                    py35_0
pip                       8.1.2                    py35_0
pkginfo                   1.3.2                    py35_0
ply                       3.9                      py35_0
prompt_toolkit            1.0.3                    py35_0
psutil                    4.3.1                    py35_0
py                        1.4.31                   py35_0
pyasn1                    0.1.9                    py35_0
pycosat                   0.6.1                    py35_1
pycparser                 2.14                     py35_1
pycrypto                  2.6.1                    py35_4
pycurl                    7.43.0                   py35_0
pyflakes                  1.3.0                    py35_0
pygments                  2.1.3                    py35_0
pylint                    1.5.4                    py35_1
pyopenssl                 16.0.0                   py35_0
pyparsing                 2.1.4                    py35_0
pyqt                      5.6.0                    py35_1
pytables                  3.2.2               np111py35_4
pytest                    2.9.2                    py35_0
python                    3.5.2                         0
python-dateutil           2.5.3                    py35_0
pytz                      2016.6.1                 py35_0
pywin32                   220                      py35_1
pyyaml                    3.12                     py35_0
pyzmq                     15.4.0                   py35_0
qt                        5.6.2                    vc14_0  [vc14]
qtawesome                 0.3.3                    py35_0
qtconsole                 4.2.1                    py35_2
qtpy                      1.1.2                    py35_0
requests                  2.11.1                   py35_0
rope                      0.9.4                    py35_1
ruamel_yaml               0.11.14                  py35_0
scikit-image              0.12.3              np111py35_1
scikit-learn              0.17.1              np111py35_1
scipy                     0.18.1              np111py35_0
setuptools                27.2.0                   py35_1
simplegeneric             0.8.1                    py35_1
singledispatch            3.4.0.3                  py35_0
sip                       4.18                     py35_0
six                       1.10.0                   py35_0
snowballstemmer           1.2.1                    py35_0
sockjs-tornado            1.0.3                    py35_0
sphinx                    1.4.6                    py35_0
spyder                    3.0.2                    py35_0
sqlalchemy                1.0.13                   py35_0
statsmodels               0.6.1               np111py35_1
sympy                     1.0                      py35_0
tk                        8.5.18                   vc14_0  [vc14]
toolz                     0.8.0                    py35_0
tornado                   4.4.1                    py35_0
traitlets                 4.3.0                    py35_0
unicodecsv                0.14.1                   py35_0
vs2015_runtime            14.0.25123                    0
wcwidth                   0.1.7                    py35_0
werkzeug                  0.11.11                  py35_0
wheel                     0.29.0                   py35_0
widgetsnbextension        1.2.6                    py35_0
win_unicode_console       0.5                      py35_0
wrapt                     1.10.6                   py35_0
xlrd                      1.0.0                    py35_0
xlsxwriter                0.9.3                    py35_0
xlwings                   0.10.0                   py35_0
xlwt                      1.1.2                    py35_0
zlib                      1.2.8                    vc14_3  [vc14]
Completed Ui Bug

Most helpful comment

is there a spyder version, which has that old theme (svg icons) and supports python 3.5?

Sure, Spyder 2.3.9. But then you'll loose the last two years and a half of bug fixes and improvements. Spyder 3.1 will be released in two weeks, so pleas be patient. For now you can manually edit Spyder Preferences to use the old theme. For that you need to find this file

C:\Users\<your user>\.spyder-{py3}\spyder.ini

open it with a text editor, find this line

icon_theme = spyder 3

change it to

icon_theme = spyder 2

and finally start Spyder again. That should let you keep working with Spyder until we provide an automated solution for this :-)


As a side note, let me clarify the situation: we don't have SVG icons and we didn't create QtAwesome out of fun. QtAwesome was our way to have scalable icons in Spyder, i.e. icons that work well on High DPI displays (our previous icon set is composed of bitmap images, and so it doesn't scale in those screens). Unfortunately that plan is now shattered by Windows 10, so we're forced to create a new theme based entirely on SVG images. That'll come in Spyder 3.2 ;-)

All 72 comments

How did you install Theano and Keras?

_I had (and still have) some SSL issues._

I followed these guides to install tensorflow first:

conda create -n tensorflow python=3.5
C:\> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl (link is updated, original was broken)

Tensorflow gave errors of missing/unfound modules (I spent quite good time to fix related issues and than gave up)
So I installed Theano successfully:
conda config --set ssl_verify False
conda update openssl cryptography
conda install theano

At last, Keras, successfully:
pip install --trusted-host pypi.python.org keras --proxy=**.**.**.**

That's the whole stroy. It looks like something has been broken in very beginning of this process. I tried to delete all configurations and packages as it has been explained in official tutorials (after all, i delete directories and hidden -.ext- files too).
Currently i'm working on ipython console with Keras on Theano backend (installed gcc too) because the lack of time in work place.

Thanks in advance.

My Spyder also crash too. When I run it from Terminal, it's okay. But from Ubuntu launcher, it just crashes.
Ubuntu 16.10 x64
Spyder 3.0.2

@alibatuhandayioglugil, it's usually not a good idea to mix compiled packages from Anaconda and pip. Please try to install all packages with conda and try again.

@ccordoba12 , i gave up with Keras, Theano and Tensorflow for now and will try to install them later as you advised (only with conda).

_Just a note, the only package that i installed via pip is Keras. As i know,It has no any relation with Qt packages and in the BE (Non IDE) side, over IPython console, everything (Keras+Theano) works fine. But as you said, it might broke something, that is another part that i have almost no knowledge in._

I just want to be able to install Spyder via Anaconda. That's what i tried for several times; without installing libraries mentioned above.
I am unable to install Spyder after uninstalling all the stuff (as mentioned in my first post) related to Anaconda and i need help with this. Can you tell me how to remove all and have a clean environment?
Thanks is advance.

spyder_crash

My last option is formatting the disk. Any idea?

@alibatuhandayioglugil, it seems you're missing QtAwesome. Please install it with

conda install qtawesome

and try again.

@ccordoba12 Already installed (In console logs-see previous comment-, there seems the error in _iconic_font.py_ file under qtawesome directory)

qrawesome

Might it be related to versions of the packages? I'm using also Qt5 (supported by windows 10)
Does it make any sense the cmd output?

spyder --show-console

Font is empty
Font is empty
Font is empty
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states
QPainter::end: Painter ended with 2 saved states

Then you have an installation problem. Please run

conda install -f qtawesome

and try again.

Did that but unfortunately still the same error...

I'm getting the same error. I just upgraded from windows 7 to windows 10 and did a clean install of Anaconda 4.2.0.

Even after reinstalling qtawesome as suggested, I get the same error messages

I tried to download the most recent tar.gz file for qtawesome and install it locally:

conda install --file=~QtAwesome-0.3.3.tar.gz

This is a truncated and (slightly edited-full path has been shortened slightly) version of the error that was returned:

An unexpected error has occurred.

.....
Current conda install:

               platform : win-64
          conda version : 4.2.9
       conda is private : False
      conda-env version : 4.2.9
    conda-build version : 2.0.2
         python version : 3.5.2.final.0
       requests version : 2.11.1
........
Traceback (most recent call last):
      File "\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\exceptions.py", line 473, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\cli\main.py", line 144, in _main
        exit_code = args.func(args, p)
      File "\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\cli\main_install.py", line 80, in execute
        install(args, parser, 'install')
      File "\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\cli\install.py", line 189, in install
        specs.extend(common.specs_from_url(fpath, json=context.json))
      File "\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\cli\common.py", line 520, in specs_from_url
        for line in open(path):
      File "\AppData\Local\Continuum\Anaconda3\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 92: character maps to <undefined>


I can also open this as a new issue in conda if necessary

conda install --file=~QtAwesome-0.3.3.tar.gz

This is not the way to install conda packages, hence the error. So please don't open a bug in conda.

This seems to be an error in QtAwesome, being unable to find FontAwesome, but I don't understand why that's happening.

@modigzd, does your username has non-ascii characters or something like a dot on it?

My username contains all ASCII characters (just letters and numbers). The install works fine in the windows 7 environment, but I can't get it to install in any of our windows 10 environments.

Unfortunately our permissions do not allow conda to connect out of network. We have a local PyPi mirror for using pip to install packages but anything like 'conda install ....' will timeout during the install process.

@alibatuhandayioglugil, do you also have restricted access to the Internet?

@ccordoba12 yes, this is my office environment and i have restricted access to the internet. Because of this, I'm using the proper http proxy before every package install/update operation and i haven't seen any connection/access errors. Are you suspicious of this probability? If so in which manner and how can i track it?

It seems QtAwesome somehow needs access to the internet and it fails when it doesn't.

@dalthviz, please take a look at this one to see if you can reproduce it on Windows without internet access.

Just to be clear: i have _qtawesome_ folders under _site-packages_. I uninstalled and reinstalled them and saw the disappeared and reappeared folders. I mean, i do have internet access.

Hi @alibatuhandayioglugil I was able to recreate the last screenshot that you post:

imagen

What I suspect that happens in your case is that the .tff files are empty or corrupt. Can you verify if the .tff files (elusiveicons-webfont.ttf and fontawesome-webfont.ttf) are empty in the route where qtawesome was install?, you can find them in ...site-packages\qtawesome\fonts. Also, can you try to copy-paste these .tff files in your fonts directory from here to discard any kind of corruption?, or try these commands:

conda uninstall qtawesome spyder
conda clean -p



md5-184d449bea6fecf0f610bde06dbdebca



conda install qtawesome spyder

Probably the command to force the install for qtawesome (conda install -f qtawesome) didn't work in your case because the cache is also corrupted. For more options of the clean command of conda you can see this link.

Please try the suggestions above and tell us if any of them works for you :)

@dalthviz, great job at reproducing this one!!

We definitely need to put a guard against this error and inform users about the right fix for it. Please work on that :-)

@dalthviz As we're in weekend i'm away from my office. As soon as i reach my PC, i will apply your fix propose and share the output here.
Thanks is advance for your effort to recreate the bug in your environment.

@dalthviz those .ttf files were unreadable. I replaced them with those that you targeted, also readable ones. This time spyder does not show up and pops up this error:

image

with this console log after closing pop-up:

C:\Users\ali.dayioglugil>spyder --show-console
Traceback (most recent call last):
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3001, in main
    mainwindow = run_spyder(app, options, args)
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 2903, in run_spyder
    main = MainWindow(options)
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 347, in __init__
    from spyder.plugins.shortcuts import ShortcutsConfigPage
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\plugins\shortcuts.py", line 780, in <module>
    class ShortcutsConfigPage(GeneralConfigPage):
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\plugins\shortcuts.py", line 784, in ShortcutsConfigPage
    ICON = ima.icon('keyboard')
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\icon_manager.py", line 257, in icon
    directory=_resource['directory'])
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\qtawesome\__init__.py", line 153, in load_font
    return _instance().load_font(prefix, ttf_filename, charmap_filename, directory)
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\qtawesome\__init__.py", line 36, in _instance
    ('ei', 'elusiveicons-webfont.ttf', 'elusiveicons-webfont-charmap.json')
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\qtawesome\iconic_font.py", line 168, in __init__
    self.load_font(*fargs)
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\site-packages\qtawesome\iconic_font.py", line 198, in load_font
    self.charmap[prefix] = json.load(codes, object_hook=hook)
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\json\__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\json\__init__.py", line 332, in loads
    return cls(**kw).decode(s)
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\ali.dayioglugil\AppData\Local\Continuum\Anaconda3\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 5 column 1 (char 4)

I tried also to uninstall, clean repo caches and reinstall qtawesome and spyder (more than one time):

image
image

Still unreadable tff files (please replace the 'png' extensions with 'tff'):
fontawesome-webfont
elusiveicons-webfont

I couldn't understand why these files get broken immediately.

@alibatuhandayioglugil please also check the .json files and try to replace them with the ones from the repo. It's really strange that the files get corrupted, however I think that replacing all the files from the fonts directory (elusiveicons-webfont-charmap.json, elusiveicons-webfont.ttf, fontawesome-webfont-charmap.json and fontawesome-webfont.ttf), will make Spyder work again.

Still unreadable tff files (please replace the 'png' extensions with 'tff')

We can't do that, sorry.


I'm guessing this is a problem with your antivirus, which could be somehow interfering with the installation of those files.

I replaced all of the files from the git repo as suggested by dalthviz. After doing so, spyder doesn't load at all. I get the following new errors, (which appear to be an issue with the json decoder)

C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2>spyder --show-console
Traceback (most recent call last):
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyder\app\mainwindow.py", line 2998, in main
    mainwindow = run_spyder(app, options, args)
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyder\app\mainwindow.py", line 2900, in run_spyder
    main = MainWindow(options)
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyder\app\mainwindow.py", line 341, in __init__
    from spyder.plugins.shortcuts import ShortcutsConfigPage
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyder\plugins\shortcuts.py", line 780, in <module>
    class ShortcutsConfigPage(GeneralConfigPage):
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyder\plugins\shortcuts.py", line 784, in ShortcutsConfigPage
    ICON = ima.icon('keyboard')
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyder\utils\icon_manager.py", line 257, in icon
    directory=_resource['directory'])
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\qtawesome\__init__.py", line 153, in load_font
    return _instance().load_font(prefix, ttf_filename, charmap_filename, directory)
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\qtawesome\__init__.py", line 36, in _instance
    ('ei', 'elusiveicons-webfont.ttf', 'elusiveicons-webfont-charmap.json')
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\qtawesome\iconic_font.py", line 168, in __init__
    self.load_font(*fargs)
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\qtawesome\iconic_font.py", line 198, in load_font
    self.charmap[prefix] = json.load(codes, object_hook=hook)
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\json\__init__.py", line 291, in load
    **kw)
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\json\__init__.py", line 352, in loads
    return cls(encoding=encoding, **kw).decode(s)
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\json\decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\json\decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

It seems the json files you're using are invalid (corrupted?). At least that's what this Stackoverflow answer suggests:

http://stackoverflow.com/a/20128856/438386

Hi everyone, @modigzd please try to copy-paste the contents of the .json files (don't download the file just use the clipboard to replace the contents), as it seems that the .ttf ones are good now.

After replacing the contents of the .jason files using copy and paste and replacing the .tff files with the ones available on the linked repo, I'm back to the original error.

I can't use conda install directly due to internet access restrictions. Is downloading the appropriate .tar.gz packages and using the --file=mypath\file.tar.gz option an acceptable solution, or does this have the potential to cause other problems?

Is downloading the appropriate .tar.gz packages and using the --file=mypathfile.tar.gz option an acceptable solution

No, it's not. You can download the right package for QtAwesome from here:

https://repo.continuum.io/

and install it using the --file option.

However, if you're seeing the initial error, I doubt that would change anything :-/

I downloaded qtawesome-0.3.2-py27_0.tar.bz2 from the continuum repo linked. After uninstalling the file and cleaning the repo caches, I attempted to install the downloaded file:

C:\Users\m3zdm00>conda install --file=C:\Users\m3zdm00\Downloads\qtawesome-0.3.2-py27_0.tar.bz2 --offline
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : win-64
          conda version : 4.2.9
       conda is private : False
      conda-env version : 4.2.9
    conda-build version : 2.0.2
         python version : 2.7.12.final.0
       requests version : 2.11.1
       root environment : C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2  (writable)
    default environment : C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2
       envs directories : C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\envs
          package cache : C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/win-64/  (offline)
                          https://repo.continuum.io/pkgs/free/noarch/  (offline)
                          https://repo.continuum.io/pkgs/pro/win-64/  (offline)
                          https://repo.continuum.io/pkgs/pro/noarch/  (offline)
                          https://repo.continuum.io/pkgs/msys2/win-64/  (offline)
                          https://repo.continuum.io/pkgs/msys2/noarch/  (offline)
            config file : None
           offline mode : True



`$ C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\Scripts\conda-script.py install --file=C:\Users\m3zdm00\Downloads\qtawesome-0.3.2-py27_0.tar.bz2 --offline`




    Traceback (most recent call last):
      File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\exceptions.py", line 473, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\cli\main.py", line 144, in _main
        exit_code = args.func(args, p)
      File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\cli\main_install.py", line 80, in execute
        install(args, parser, 'install')
      File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\cli\install.py", line 189, in install
        specs.extend(common.specs_from_url(fpath, json=context.json))
      File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\cli\common.py", line 532, in specs_from_url
        (line, url))
      File "C:\Users\m3zdm00\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\exceptions.py", line 350, in __init__
        msg = 'Value error: %s' % message
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xb7 in position 29: ordinal not in range(128)

I run into an ascii error, as can be seen. I've left the full paths in, and as you can see, there aren't any non-ascii characters in the username or any of the paths.

@modigzd, there's something definitely some wrong with your installation. I don't know what it could be though...

I used the same exact install file on the same machine when it was running windows 7. I had no problems.

I've also tried using the same install file on a different machine running windows 10, with the same results (Spyder crashed).

About the corrupted .ttf files, maybe this post can be related with the issue, it's some kind of failure in Windows 10 to install fonts.

@ccordoba12 @dalthviz I got the exact same issue with @alibatuhandayioglugil.

@dalthviz Thank you for that post. If I attempt to preview the .tff files I get the same error. When I am able test the proposed solution I will let you know the result.

Hi @zhifaliu, do you have a Windows 10 environment?, did you also try the suggestions above?

@dalthviz Yes, I am using windows 10 and tried all those suggestions above.

@dalthviz @ccordoba12

When I was manually installing the qtawesome package, I found the UnicodeDecodeError: 'ascii' codec can't decode byte 0xb7 in position 29: ordinal not in range(128)

In linux, I am able to do

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

But don't know how to enforce the Unicode to UTF-8 in Windows

C:\WINDOWS\system32>conda install --file C:\Users\nosa\Downloads\qtawesome-0.3.2-py27_0.tar.bz2
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : win-64
          conda version : 4.2.13
       conda is private : False
      conda-env version : 4.2.13
    conda-build version : 2.0.2
         python version : 2.7.12.final.0
       requests version : 2.11.1
       root environment : C:\Program Files\Anaconda2  (writable)
    default environment : C:\Program Files\Anaconda2
       envs directories : C:\Program Files\Anaconda2\envs
          package cache : C:\Program Files\Anaconda2\pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : None
           offline mode : False



`$ C:\Program Files\Anaconda2\Scripts\conda-script.py install --file C:\Users\nosa\Downloads\qtawesome-0.3.2-py27_0.tar.bz2`




    Traceback (most recent call last):
      File "C:\Program Files\Anaconda2\lib\site-packages\conda\exceptions.py", line 479, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Program Files\Anaconda2\lib\site-packages\conda\cli\main.py", line 145, in _main
        exit_code = args.func(args, p)
      File "C:\Program Files\Anaconda2\lib\site-packages\conda\cli\main_install.py", line 80, in execute
        install(args, parser, 'install')
      File "C:\Program Files\Anaconda2\lib\site-packages\conda\cli\install.py", line 189, in install
        specs.extend(common.specs_from_url(fpath, json=context.json))
      File "C:\Program Files\Anaconda2\lib\site-packages\conda\cli\common.py", line 532, in specs_from_url
        (line, url))
      File "C:\Program Files\Anaconda2\lib\site-packages\conda\exceptions.py", line 356, in __init__
        msg = 'Value error: %s' % message
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xb7 in position 29: ordinal not in range(128)

All, please try to enable the Windows Firewall in your computers to see if that fixes this error for you.

@ccordoba12 , still the same error even you turn on or turn off for Windows Firewalls.

@ccordoba12 it is working perfectly fine and be able to open those .tff files in qtawesome folder on windows 7.

But it get failed in opening the .tff files in Windows 10 pro. Those .tff files are not empty and not corrupted.
Looks like the user is unable to install those font files...my guess

@dalthviz @ccordoba12 modifying and/or replacing the files under /fonts directory didn't resolve my situation. I couldn't spend enough time on this issue because of workload.
I don't think that it is a network restriction or firewall issue because i installed and used (and still using) spyder in the same network on a windows 7 machine. Like @zhifaliu, i think that it may be a windows 10 related thing.
I really like the Spyder IDe (using on Mint and on Ubuntu with all needed libraries) and i really want to resolve this issue. I appreciate your effort and hope we can find a solution all together. As my workload gets lighter i will get on this again.

Apparently Windows 10 has a new setting that blocks fonts from loading outside of the c:windowsfonts folder. If the application cannot be configured to use the fonts folder, the mitigation options described in the below article can be used:

https://support.microsoft.com/en-us/kb/3053676

The appropriate steps that I used from the article are given below:

First, I had to create the python.exe registry key here:
HKEY_LOCAL_MACHINE SoftwareMicrosoftWindows NTCurrentVersionImage File Execution Optionspython.exe

Then I right-clicked and added a new QWORD (64-bit) Value, named MitigationOptions.

I set the (hex) value as 2000000000000

After performing the above steps, Spyder launched without issue

@modigzd great work for finding the solution to this (really ugly!) problem!! Kudos to you :-)

Is the addition of the registry entry something that can be done without Administrator privileges?

Pinging also @mingwandroid about this one because it'll prevent the use of fonts provided by Anaconda.

@dalthviz, please try to use the pywin32 package to see if you can programmaticaly create the registry entry described by @modigzd.

@ccordoba12 I think the addition on the registry in HKEY_LOCAL_MACHINE needs admin privileges. However, in the link that @modigzd gives, there is a set of steps that a user can follow without touching the registry (but maybe also will need admin privileges). Maybe we could use this steps in a message when we detect the exception of being unable to load the font as a suggestion for solution.

We don't support the CONDA_PREFIX/fonts folder on Windows yet, but this sounds like it will be problematic for when I do try to enable that.

We don't support the CONDA_PREFIX/fonts folder on Windows yet, but this sounds like it will be problematic for when I do try to enable that.

well if we are going to need admin privileges, yes it is going to be a problem. Thanks Microsoft!

It's the usual functionality vs security arguments. Apple's SIP is similar. If necessary we can bypass Windows native font handling and use Freetype in Qt, I expect!

While it seems like this is an issue that will be mitigated in future releases, I want to add one more thing for anyone else looking for an interim solution:

It was necessary to add both a python.exe and pythonw.exe registry key using the steps above. The python.exe registry key allowed me to launch spyder from the command prompt, the pythonw.exe key allowed me to launch spyder from the start menu/spyder icon.

@modigzd happy to hear good news. I tried Microsoft's method but still the same error.
image

It made me think 'doesn't the problematic fonts belong to spyder? why do we add a key for python?' (Example case given by microsoft was MS Word) Every registry modification requires admin privileges and i have to start an issue to infrastructure team (takes long time). That's why i ask such a simple question here instead of trying it.

And also, did this solution worked for you @zhifaliu

@alibatuhandayioglugil it is impossible for us to do a manual registry modification for those 200 spyder users. And It won't be approved in IT admin

@zhifaliu we were able to successfully push a script through SCCM that makes the registry modification during the installation process so that we didn't have to manually do it for all of the spyder users at our location

I was skeptical of the approval process myself, but as the fix came directly from Microsoft, they approved for us. If you have recently switched to Windows 10 this will likely not be the only time a similar issue comes up.

@modigzd @ccordoba12 @dalthviz is it possible to patch the qtawesome incompatibility issue (I don't call it is a bug) very soon for Windows 10? The bad thing is we have pushed our 200 users to windows 10 OS upgrade in last month, so we have no choice if we want to use spyder in windows 10.

is it possible to patch the qtawesome incompatibility issue (I don't call it is a bug) very soon for Windows 10?

Sorry, there's no incompatibility to patch or any change we can do in QtAwesome because QtAwesome was designed to provide a way to use font icon sets in Qt applications. Since Windows 10 prevents (at OS level) to read fonts outside of C:\Windows\Fonts, there's nothing we can about it.

What we can do for now is to provide a way to use our fallback theme (the one used in Spyder 2) at startup in Spyder 3.1. After that I think the only solution is for us to move to use SVG icons instead of relying on font icon sets.

Gosh, Windows 10 created a big problem for us.... :-/

Just an idea; is there a spyder version, which has that old theme (svg icons) and supports python 3.5? Funny interfaces is nice to have but not necessary. I tried 2.6 but got a conflict with python 3.5 (I know i can change my python version but before that i'd like to ask here)

is there a spyder version, which has that old theme (svg icons) and supports python 3.5?

Sure, Spyder 2.3.9. But then you'll loose the last two years and a half of bug fixes and improvements. Spyder 3.1 will be released in two weeks, so pleas be patient. For now you can manually edit Spyder Preferences to use the old theme. For that you need to find this file

C:\Users\<your user>\.spyder-{py3}\spyder.ini

open it with a text editor, find this line

icon_theme = spyder 3

change it to

icon_theme = spyder 2

and finally start Spyder again. That should let you keep working with Spyder until we provide an automated solution for this :-)


As a side note, let me clarify the situation: we don't have SVG icons and we didn't create QtAwesome out of fun. QtAwesome was our way to have scalable icons in Spyder, i.e. icons that work well on High DPI displays (our previous icon set is composed of bitmap images, and so it doesn't scale in those screens). Unfortunately that plan is now shattered by Windows 10, so we're forced to create a new theme based entirely on SVG images. That'll come in Spyder 3.2 ;-)

@ccordoba12 Thanks for the tip. Now I am able to launch Spyder again. It may be my mistake but the IDE looks very much like Spyder 3 (I checked the .ini file after modification and revert theme to 3 and then remodified to 2, just to be sure)

image

Looking forward to see Spyder 3.2 and a world without MS Windows.

Thanks all for tracking down this issue and esp. to ccordoba12 for the workaround using Spyder 2 fonts. This has given me a great deal of grief as I had my OS upgraded to Win10 by our IT folks.

Can we find a way to get this info out to a wider audience? It took me a lot of searching and trial and error re-installations, package upgrades, etc. on my own before finding this issue & solution.

Just a thought, and again, thanks for all the work and for Spyder itself.

Cheers!

What happened with this ? I have the same probleme.

Hi @cecidip could you try to update Spyder to 3.3.6? The problem here basically was the load of the font files needed for the Spyder 3 icon theme on Windows 10 (where a Windows feature can block loading fonts outside Window's font folder). Also, after Spyder version 3.1 we automatically do a fallback to the icons used by Spyder 2 (if we detect errors when loading the font), so probably updating Spyder should fix the issue for you.

@dalthviz my spyder version is: spyder 3.3.6 py37_1 conda-forge
and i dont have windows. I have macOS Catalina 10.15 (19A602) and i am connected to linux (CentOS Linux 7 (Core) )through ssh (XQuartz)

Um seems like we are having issues with that version of Mac OS, maybe something in issues like #10406 can help but I think the issues goes beyond Spyder, sorry :/

@dalthviz this was happening before my update of mac ( which happened just a week ago) . Before this i uninstaled and re-installed anaconda completely, but still spyder didnt work.

@cecidip I will check on my Mac and ping back

I have macOS Catalina 10.15 (19A602) and i am connected to linux (CentOS Linux 7 (Core) )through ssh (XQuartz)

So the problem is on Mac, on Linux? or are you openning spyder (on linux) via XQuartz while on Mac?

@goanpeca "or are you openning spyder (on linux) via XQuartz while on Mac?" exactly.

@goanpeca, please open a new issue about this. This issue is already registered in our Changelog, so we can't reopen it again.

ok

@cecidip let's continue over at https://github.com/spyder-ide/spyder/issues/10501

Was this page helpful?
0 / 5 - 0 ratings