Spyder crashing upon startup because it trying to load IPython, which is executing error-ful code in PYTHONPATH?

71 views
Skip to first unread message

Brian Merchant

unread,
Sep 1, 2016, 4:01:42 PM9/1/16
to spyder
Hi All,

I am using the latest version of Spyder available with Anaconda Python (Python 2.7).

I am finding that when I start Spyder, it tries to load IPython, which in turn is executing error-ful code in PYTHONPATH.

That code has errors, so Spyder is crashing, and never gets to start up.

C:\Users\Brian Merchant>spyder
Traceback (most recent call last):
  File "C:\Users\Brian Merchant\Anaconda2\Scripts\spyder-script.py", line 2, in <module>
    start_app.main()
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\spyderlib\start_app.py", line 114, in main
    from spyderlib import spyder
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\spyderlib\spyder.py", line 137, in <module>
    from spyderlib.ipythonconfig import IPYTHON_QT_INSTALLED
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\spyderlib\ipythonconfig.py", line 24, in <module>
    required_version=IPYTHON_REQVER)
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\spyderlib\dependencies.py", line 70, in add
    installed_version)]
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\spyderlib\dependencies.py", line 32, in __init__
    self.installed_version = programs.get_module_version(modname)
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\spyderlib\utils\programs.py", line 238, in get_module_version
    mod = __import__(module_name)
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\IPython\__init__.py", line 48, in <module>
    from .core.application import Application
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\IPython\core\application.py", line 22, in <module>
    from traitlets.config.application import Application, catch_config_error
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\traitlets\config\__init__.py", line 6, in <module>
    from .application import *
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\traitlets\config\application.py", line 18, in <module>
    from traitlets.config.configurable import Configurable, SingletonConfigurable
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\traitlets\config\configurable.py", line 12, in <module>
    from .loader import Config, LazyConfigValue, _is_section_key
  File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\traitlets\config\loader.py", line 14, in <module>
    from ast import literal_eval
  File "C:\proofor\ast.py", line 99, in <module>
    res = parser.parse(t0)
  File "C:\proofor\ast.py", line 94, in parse
    return self.expression_parser(expression_str)
  File "C:\proofor\ast.py", line 87, in expression_parser
    expressions.append(parser_fn(expression_str[n+1:post_delimiter_pos - len(delimiter)]))
  File "C:\proofor\ast.py", line 85, in expression_parser
    post_delimiter_pos = self.delimiter_seek(limiter, delimiter, expression_str[n+1:], pos_offset=n+1)
  File "C:\proofor\ast.py", line 65, in delimiter_seek
    raise StandardError("Limiter {} mismatch exists.".format(limiter))
StandardError: Limiter None mismatch exists.

==================

Similarly, if I just type in "ipython" in the command line, I will have a similar error.

I am putting the folder that has that bit of code in PYTHONPATH because I want easy access to it while working on it. This is usually what I do (I have some other projects in PYTHONPATH similarly), and it is the first time I am getting such errors as a result.

What can I do to fix this issue?

Kind regards,
Brian

Brian Merchant

unread,
Sep 1, 2016, 6:16:08 PM9/1/16
to spyder
Hi all,

To update you: now Spyder does not even crash, it just hangs on startup.

I tried to uninstall IPython and Spyder, and reinstall everything, but still no luck.

I tried to reset Spyder, but it is also hanging.

Any help would be appreciated!

Kind regards,
Brian

Brian Merchant

unread,
Sep 1, 2016, 6:25:27 PM9/1/16
to spyder
Well, the good news is that Spyder is hanging because the error-ful code is hanging: so the problem is still the same...

Jitse Niesen

unread,
Sep 2, 2016, 9:36:36 AM9/2/16
to spyder

On 01/09/16 21:01, Brian Merchant wrote:

I am finding that when I start Spyder, it tries to load IPython, which
in turn is executing error-ful code in PYTHONPATH.

That code has errors, so Spyder is crashing, and never gets to start up.

C:\Users\Brian Merchant>spyder
Traceback (most recent call last):
[...]
File "C:\Users\Brian Merchant\Anaconda2\lib\site-packages\traitlets\config\loader.py", line 14, in <module>
from ast import literal_eval
File "C:\proofor\ast.py", line 99, in <module>
res = parser.parse(t0)
[...]

IPython (and indirectly Spyder) uses the ast module in the standard library. It looks like the directory you added to PYTHONPATH also has an ast module in it, thus causing IPython to use that module instead of the module in the standard library. I guess you never had this issue before because you did not have an ast.py file in your own code.

Is it possible to rename your own ast.py? That may the easiest solution.


Jitse

Reply all
Reply to author
Forward
0 new messages