Hi Carlos,

I just encountered the same error on Spyder 3.0.2 :(
Win10 64bit, an environment of Miniconda 2 with Python 2.7.13.

The error:
Traceback (most recent call last):
  File 
"C:\Miniconda2\envs\default_py2\lib\site-packages\qtconsole\base_frontend_mixin.py"
, line 163, in _dispatch
    handler(msg)
  File 
"C:\Miniconda2\envs\default_py2\lib\site-packages\spyder\widgets\ipythonconsole\namespacebrowser.py"
, line 189, in _handle_execute_reply
    self.handle_exec_method(msg)
  File 
"C:\Miniconda2\envs\default_py2\lib\site-packages\spyder\widgets\ipythonconsole\shell.py"
, line 242, in handle_exec_method
    properties = ast.literal_eval(data['text/plain'])
KeyError: 'text/plain'

>From spyder\widgets\ipythonconsole\shell.py, lines 234-249:
data = reply.get('data')
    if 'get_namespace_view' in method:
        if data is not None and 'text/plain' in data:
            view = ast.literal_eval(data['text/plain'])
            self.sig_namespace_view.emit(view)
        else:
            view = None
    elif 'get_var_properties' in method:
        properties = ast.literal_eval(data['text/plain'])
        self.sig_var_properties.emit(properties)
    else:
        if data is not None:
            self._kernel_reply = ast.literal_eval(data['text/plain'])
        else:
            self._kernel_reply = None
        self.sig_got_reply.emit()

It seems the current solution works only for the first condition (if 
'get_namespace_view' in method) but not for the others (elif 
'get_var_properties' in method, else).

I hope this will help somehow, please tell me if you need more info.


Thanks,
Shaked


On Thursday, October 20, 2016 at 5:35:14 PM UTC+3, Carlos Córdoba wrote:
>
> Ok, I don't understand how this error is generated but we can fix it by 
> inserting the line that gives the error in a try/except block.
>
> I'll do that for 3.0.2, to be released next week :-)
>
>
> Cheers,
> Carlos
>
> El 20/10/16 a las 01:19, Jack escribió:
>
> sorry, python 2
>
>
> Carlos Córdoba於 2016年10月20日星期四 UTC+8上午10時00分49秒寫道: 
>>
>> Are you using Python 2 or 3?
>>
>> El 19/10/16 a las 20:05, Jack escribió:
>>
>> I got the similar issue in Spyder 3.0.0 and even Spyder 3.0.1 after run 
>> the following code 
>>
>> import sys  
>> reload(sys)
>>
>> The error code in internal console are as follows
>>
>> >>> Traceback (most recent call last):
>>   File "C:\Anaconda\lib\site-packages\qtconsole\base_frontend_mixin.py", 
>> line 163, in _dispatch
>> Traceback (most recent call last):
>>   File "C:\Anaconda\lib\site-packages\qtconsole\base_frontend_mixin.py", 
>> line 163, in _dispatch
>>     handler(msg)
>>   File 
>> "C:\Anaconda\lib\site-packages\spyder\widgets\ipythonconsole\namespacebrowser.py",
>>  
>> line 188, in _handle_execute_reply
>>     self.handle_exec_method(msg)
>>   File 
>> "C:\Anaconda\lib\site-packages\spyder\widgets\ipythonconsole\shell.py", 
>> line 227, in handle_exec_method
>>     properties = ast.literal_eval(data['text/plain'])
>> KeyError: 'text/plain'
>>     handler(msg)
>>   File 
>> "C:\Anaconda\lib\site-packages\spyder\widgets\ipythonconsole\namespacebrowser.py",
>>  
>> line 188, in _handle_execute_reply
>>     self.handle_exec_method(msg)
>>   File 
>> "C:\Anaconda\lib\site-packages\spyder\widgets\ipythonconsole\shell.py", 
>> line 224, in handle_exec_method
>>     view = ast.literal_eval(data['text/plain'])
>> KeyError: 'text/plain'
>>
>> hope those information could help solve the issue
>>
>> Thank you,
>> Jack
>>
>>
>> silentquasar於 2016年10月18日星期二 UTC+8上午8時23分52秒寫道: 
>>>
>>> Edit: This is a consistent issue on both of my machines--not just the 
>>> one as I had originally said. 
>>> -Randy
>>>
>>> On Monday, October 17, 2016 at 12:56:49 PM UTC-7, silentquasar wrote: 
>>>>
>>>> Hi, 
>>>>
>>>> I just created a new Python 3.4 Anaconda environment from Miniconda 2. 
>>>> (Win 7 64-bit).
>>>>
>>>> I fired up Spyder 3 and every time I enter a command in the IPython 
>>>> console, I get the following error in the Internal Console:
>>>> Traceback (most recent call last):
>>>>   File 
>>>> "E:\Miniconda2\envs\py34\lib\site-packages\qtconsole\base_frontend_mixin.py",
>>>>  
>>>> line 163, in _dispatch
>>>>     handler(msg)
>>>>   File 
>>>> "E:\Miniconda2\envs\py34\lib\site-packages\spyder\widgets\ipythonconsole\namespacebrowser.py",
>>>>  
>>>> line 188, in _handle_execute_reply
>>>>     self.handle_exec_method(msg)
>>>>   File 
>>>> "E:\Miniconda2\envs\py34\lib\site-packages\spyder\widgets\ipythonconsole\shell.py",
>>>>  
>>>> line 225, in handle_exec_method
>>>>     properties = ast.literal_eval(data['text/plain'])
>>>>   File "E:\Miniconda2\envs\py34\lib\ast.py", line 46, in literal_eval
>>>>     node_or_string = parse(node_or_string, mode='eval')
>>>>   File "E:\Miniconda2\envs\py34\lib\ast.py", line 35, in parse
>>>>     return compile(source, filename, mode, PyCF_ONLY_AST)
>>>>   File "<unknown>", line 19
>>>>     'numpy': {'array_ndim': <function numpy.core.fromnumeric.ndim>,
>>>>                             ^
>>>> SyntaxError: invalid syntax
>>>>
>>>> I created the same environment on a different Win 7 64-bit PC and don't 
>>>> get this error. Any ideas, or instructions on how I can debug this?
>>>>
>>>> A few items from 'conda list':
>>>> anaconda -> 4.2.0 py34_0
>>>> ipython -> 5.1.0 py34_0
>>>> numpy -> 1.11.1 py34_0
>>>> python -> 3.4.5 
>>>> qt -> 5.6.0 v10_0
>>>> qtconsole -> 4.2.1 py34_0
>>>> spyder -> 3.0.0 py34_0
>>>>
>>>> Thanks,
>>>> Randy
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "spyder" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/spyderlib.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
> You received this message because you are subscribed to the Google Groups 
> "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at https://groups.google.com/group/spyderlib.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to