Problem with input() in Spyder 5.1.5 (Anaconda)

Problem with input() in Spyder 5.1.5 (Anaconda)

错误提示

Traceback (most recent call last):
  File "C:\Users\clu\Anaconda3\lib\site-packages\qtconsole\base_frontend_mixin.py", line 138, in _dispatch
    handler(msg)
  File "C:\Users\clu\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\widgets\debugging.py", line 278, in _handle_input_request
    return super(DebuggingWidget, self)._handle_input_request(msg)
  File "C:\Users\clu\Anaconda3\lib\site-packages\qtconsole\frontend_widget.py", line 512, in _handle_input_request
    self._readline(msg['content']['prompt'], callback=callback, password=msg['content']['password'])
  File "C:\Users\clu\Anaconda3\lib\site-packages\qtconsole\console_widget.py", line 2422, in _readline
    self._show_prompt(prompt, newline=False, separator=False)
TypeError: _show_prompt() got an unexpected keyword argument 'separator'

 

方案1

Hey @EgonHeuson, thanks for reporting. This error is fixed in our latest version (5.3.0).

Since it's still not available in Anaconda, you have two options:

  1. Use our Mac installer, which you can find here.

  2. Create a new environment with conda-forge packages. For that, please close Spyder, open the Anaconda Prompt and run the following commands there:

     conda create -n spyder-cf -c conda-forge spyder
     conda activate spyder-cf
     spyder

 

执行完第一个命令之后的提示

done
#
# To activate this environment, use
#
#     $ conda activate spyder-cf
#
# To deactivate an active environment, use
#
#     $ conda deactivate

这样打开的spyder就是最新的版本5.3.3,而之前有问题的版本是5.1.5

 

方案2

They updated recently to version 5.2.2, which also fixes this problem. To update to it you need to run

conda update anaconda
conda install spyder=5.2.2

 

posted @ 2022-09-03 10:45  ChuckLu  阅读(527)  评论(0编辑  收藏  举报