Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with input() in Spyder 5.1.5 (Anaconda) #17616

Closed
EgonHeuson opened this issue Apr 5, 2022 · 51 comments
Closed

Problem with input() in Spyder 5.1.5 (Anaconda) #17616

EgonHeuson opened this issue Apr 5, 2022 · 51 comments

Comments

@EgonHeuson
Copy link

Description

What steps will reproduce the problem?

Only when I try to execute an "input()" command, it crashes.
"inputValue = input()"

Traceback

Traceback (most recent call last):
  File "/Users/egonheuson/opt/anaconda3/lib/python3.9/site-packages/qtconsole/base_frontend_mixin.py", line 138, in _dispatch
    handler(msg)
  File "/Users/egonheuson/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/ipythonconsole/widgets/debugging.py", line 278, in _handle_input_request
    return super(DebuggingWidget, self)._handle_input_request(msg)
  File "/Users/egonheuson/opt/anaconda3/lib/python3.9/site-packages/qtconsole/frontend_widget.py", line 512, in _handle_input_request
    self._readline(msg['content']['prompt'], callback=callback, password=msg['content']['password'])
  File "/Users/egonheuson/opt/anaconda3/lib/python3.9/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'

Versions

  • Spyder version: 5.1.5
  • Python version: 3.9.7
  • Qt version: 5.9.7
  • PyQt5 version: 5.9.2
  • Operating System: Darwin 21.4.0

Dependencies


# Mandatory:
applaunchservices >=0.1.7     :  0.2.1 (OK)
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  8.2.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.4.0 (OK)
nbconvert >=4.0               :  6.3.0 (OK)
numpydoc >=0.6.0              :  1.2 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0;<2.10.0        :  2.9.6 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.2.2;<1.3.0          :  1.2.4 (OK)
pylsp_black >=1.0.0           :  None (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=1.0.2             :  1.0.3 (OK)
qtconsole >=5.1.0             :  5.3.0 (OK)
qtpy >=1.5.0                  :  2.0.1 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  58.0.4 (OK)
sphinx >=0.6.6                :  4.4.0 (OK)
spyder_kernels >=2.1.1;<2.2.0 :  2.1.3 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
zmq >=17                      :  22.3.0 (OK)

# Optional:
cython >=0.21                 :  0.29.28 (OK)
matplotlib >=2.0.0            :  3.5.1 (OK)
numpy >=1.7                   :  1.21.2 (OK)
pandas >=1.1.1                :  1.4.1 (OK)
scipy >=0.17.0                :  1.7.3 (OK)
sympy >=0.7.3                 :  1.10.1 (OK)
@ccordoba12
Copy link
Member

ccordoba12 commented Apr 5, 2022

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
    

@EgonHeuson
Copy link
Author

EgonHeuson commented Apr 6, 2022 via email

@ghost
Copy link

ghost commented Apr 7, 2022

Excellent, than you very much!

@pjm07
Copy link

pjm07 commented Apr 21, 2022

I have run into the same problem as the OP and taken all the steps recommended above to rectify it. However, when I try to connect Spyder to my base Python environment, I get the error message pictured here:
image

@ccordoba12
Copy link
Member

@pjm07, you need to install spyder-kernels 2.3.0 in your base environment, but that version is still not available in Anaconda.

@pjm07
Copy link

pjm07 commented Apr 21, 2022

@pjm07, you need to install spyder-kernels 2.3.0 in your base environment, but that version is still not available in Anaconda.

In my base environment, I used Anaconda prompt to execute conda config --append channels conda-forge and then conda install spyder-kernels=2.3. After taking a long time to solve the environment, it's been examining for conflicts for the past few hours and is only at 3%. I take it this isn't normal, but I don't know how else to install the right version of spyder-kernels.

@ccordoba12
Copy link
Member

ccordoba12 commented Apr 21, 2022

You can't mix Conda and Conda-Forge packages, so that's why you can't do that.

@lsevedge

This comment was marked as off-topic.

@ackerman-alex
Copy link

@ccordoba12 and/ or @dalthviz I am also having an internal error pop up when I try to use the input() to call a file name.

runfile('C:/Users/alexa/.spyder-py3/temp.py', wdir='C:/Users/alexa/.spyder-py3')
Traceback (most recent call last):
File ~.spyder-py3\temp.py:8 in
name = input("Enter file name: ")
File ~\anaconda3\lib\site-packages\ipykernel\kernelbase.py:1075 in raw_input
return self._input_request(
File ~\anaconda3\lib\site-packages\ipykernel\kernelbase.py:1120 in _input_request
raise KeyboardInterrupt("Interrupted by user") from None
KeyboardInterrupt: Interrupted by user

I uninstalled and reinstalled both anaconda and Spyder with no success.

I am a new to programming and sincerely appreciate any support you can provide. Thank you.

@ccordoba12
Copy link
Member

Hey @ackerman-alex, please download and install our Windows installer, which shouldn't have this error. You can find it here:

https://github.com/spyder-ide/spyder/releases

@ackerman-alex
Copy link

@ccordoba12 I redownloaded Spyder via your windows installer and the issue is still there. Spyder is also telling me it is up to date.

Versions:

Spyder version: 5.1.5
Python version: 3.9.12 64-bit
Qt version: 5.9.7
PyQt5 version: 5.9.2
Operating System: Windows 10

@ackerman-alex
Copy link

@ccordoba12 I redownloaded Spyder 5.3.1 via your windows installer and the issue is still there. Spyder is also telling me it is up to date.

Issue is still only with input(). I have also tried reinstalling anaconda and that did not help.

Versions:

Spyder version: 5.1.5
Python version: 3.9.12 64-bit
Qt version: 5.9.7
PyQt5 version: 5.9.2
Operating System: Windows 10

Dependancies

Mandatory:

atomicwrites >=1.2.0 : 1.4.0 (OK)
chardet >=2.0.0 : 4.0.0 (OK)
cloudpickle >=0.5.0 : 2.0.0 (OK)
cookiecutter >=1.6.0 : 1.7.3 (OK)
diff_match_patch >=20181111 : 20200713 (OK)
intervaltree >=3.0.2 : 3.1.0 (OK)
IPython >=7.6.0 : 8.3.0 (OK)
jedi >=0.17.2;<0.19.0 : 0.18.1 (OK)
jsonschema >=3.2.0 : 4.4.0 (OK)
keyring >=17.0.0 : 23.4.0 (OK)
nbconvert >=4.0 : 6.4.4 (OK)
numpydoc >=0.6.0 : 1.2 (OK)
paramiko >=2.4.0 : 2.8.1 (OK)
parso >=0.7.0;<0.9.0 : 0.8.3 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.8.0 (OK)
pygments >=2.0 : 2.11.2 (OK)
pylint >=2.5.0;<2.10.0 : 2.9.6 (OK)
pyls_spyder >=0.4.0 : 0.4.0 (OK)
pylsp >=1.2.2;<1.3.0 : 1.2.4 (OK)
pylsp_black >=1.0.0 : None (OK)
qdarkstyle =3.0.2 : 3.0.2 (OK)
qstylizer >=0.1.10 : 0.1.10 (OK)
qtawesome >=1.0.2 : 1.0.3 (OK)
qtconsole >=5.1.0 : 5.3.0 (OK)
qtpy >=1.5.0 : 2.0.1 (OK)
rtree >=0.9.7 : 0.9.7 (OK)
setuptools >=49.6.0 : 61.2.0 (OK)
sphinx >=0.6.6 : 4.4.0 (OK)
spyder_kernels >=2.1.1;<2.2.0 : 2.1.3 (OK)
textdistance >=4.2.0 : 4.2.1 (OK)
three_merge >=0.1.1 : 0.1.1 (OK)
watchdog >=0.10.3 : 2.1.6 (OK)
zmq >=17 : 22.3.0 (OK)

Optional:

cython >=0.21 : 0.29.28 (OK)
matplotlib >=2.0.0 : 3.5.1 (OK)
numpy >=1.7 : 1.21.5 (OK)
pandas >=1.1.1 : 1.4.2 (OK)
scipy >=0.17.0 : 1.7.3 (OK)
sympy >=0.7.3 : 1.10.1 (OK)

@ccordoba12
Copy link
Member

You're still using the Spyder version that comes with Anaconda. To avoid that problem you could uninstall Anaconda.

@ackerman-alex
Copy link

@ccordoba12 uninstalling Anaconda seems to work. I was unaware I could use Spyder as a standalone.

This is probably a stupid question, but will there be any functionality loss using Spyder as a standalone?

Thank you so much for your help. I sincerely appreciate you taking the time to help me out.

@ccordoba12
Copy link
Member

This is probably a stupid question, but will there be any functionality loss using Spyder as a standalone?

You can only use the packages that come with it, i.e. Numpy, Pandas, Matplotlib, Scipy and Sympy. If you need to use other packages, you need to follow the instructions in our docs, but replacing all commands that start with conda install by conda install -c conda-forge.

We are aware that's very cumbersome and we're working to improve it, hopefully by the end of the year.

Thank you so much for your help. I sincerely appreciate you taking the time to help me out.

No problem. I'm glad to know that you were able to successfully use Spyder again.

@NishatTasnimMim
Copy link

this worked. thanks @ccordoba12

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
    

After that, you can connect Spyder to your base environment by following these instructions:

http://docs.spyder-ide.org/current/faq.html#using-existing-environment

@CoveMach
Copy link

CoveMach commented Jul 1, 2022

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
    

Since I did this, whenever I open Spyder and try to run my code that ran perfectly fine before hand, I get all kinds of module errors. I'm told that I don't have Pandas as a module, when it is in the right path, and pip installed and updates, I'm told "ImportError: Can't determine version for numexpr", I get 'json_normalize is not in Pandas' when it is, and the fix for that which I was using before it says json_normalize doesn't exist. I have no clue what happened, but would like to take a step backwards. How would I undo the install you wrote?

@akash9a
Copy link

akash9a commented Jul 10, 2022

not taking input

@ghost
Copy link

ghost commented Jul 10, 2022

привет @ccordoba12

Привет@EgonHeuson, спасибо за отчет. Эта ошибка исправлена ​​в нашей последней версии (5.3.0).

он по-прежнему недоступен в Anaconda, у вас есть два варианта:

  1. наш установщик для Mac, который вы можете найти здесь .
  2. установить новую среду с пакетами conda-forge. Для этого закройте Spyder, администрацию Anaconda Prompt и подключите туда команду:
     conda create -n spyder-cf -c conda-forge spyder
     conda activate spyder-cf
     spyder
    

я сделал как вы говорили
photo_2022-07-10_18-09-15
он спросит Удалить существующую среду. что мне дальше делать?

@ghost
Copy link

ghost commented Jul 10, 2022

нуууу.. я пока новичок я не знаю что писать дальше

@ghost
Copy link

ghost commented Jul 10, 2022

надо сделать видео по решению этого проблема. что бы было проще

@ccordoba12
Copy link
Member

@CoveMach, you need to install all libraries you need to use in the new spyder-cf environment. For instance, to use numexpr you need to close Spyder, open the Anaconda Prompt and run there

conda activate spyder-cf
conda install -c conda-forge numexpr

@ccordoba12
Copy link
Member

@akash9a, every time you need to start Spyder, you need to open the Anaconda Prompt and run there

conda activate spyder-cf
spyder

That will launch our latest version (i.e. 5.3.1) instead of the one that comes with Anaconda.

@ccordoba12
Copy link
Member

@saidkamolsam, вы сказали

он спросит Удалить существующую среду. что мне дальше делать?

Вам больше ничего не нужно делать. С этого момента просто выполняйте следующие команды:

conda activate spyder-cf
spyder

Надеюсь, мои сообщения хорошо переведены на русский язык (я использовал автоматический переводчик).

@ghost
Copy link

ghost commented Jul 11, 2022

ok спасибо

@ghost
Copy link

ghost commented Jul 11, 2022

😀🥳сработало!!!
СПАСИБО!!!

@ccordoba12
Copy link
Member

Отлично! Спасибо, что сообщили нам об этом.

@kmkieva
Copy link

kmkieva commented Jul 15, 2022

I am absolutely new to programming and to Python/Spyder, and I'm having the same issue, Spyder crashes whenever I try to run the input function. I installed the standalone Spyder but I can't get the correct version to run. Can anyone help me?

@impact27 impact27 unpinned this issue Jul 16, 2022
@dalthviz
Copy link
Member

Hi @kmkieva if you installed the standalone version you need to run it from the created shortcut (it should be called Spyder if you search in you Start menu on Windows or with spotlight on MacOS). If that doesn't work for you, you can follow the second option described here which is to create a new Python environment to install Spyder from the conda-forge channel. For that you will need to run the following commands from an Anaconda prompt (if you are on Windows) or the terminal (if you are on MacOS):

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

The first command creates the new environment, the second command activates the new environment and the last command launches Spyder.

@tianyihutt
Copy link

tianyihutt commented Jul 22, 2022

I failed when running the first line.

(base) C:\Users\T>conda create -n spyder-cf -c conda-forge spyder
Collecting package metadata (current_repodata.json): failed

ProxyError: Conda cannot proceed due to an error in your proxy configuration.
Check for typos and other configuration errors in any '.netrc' file in your home directory,
any environment variables ending in '_PROXY', and any other system-wide proxy
configuration settings.

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
    

@anorreyv
Copy link

Hi, I have tried all of the fixes in the above thread and I'm still experiencing the same issues as OP. Are there any other resources I can look into?

@dalthviz
Copy link
Member

Hi @anorreyv are you not able to create a conda env using the conda-forge channel? Are you sure you are launching the correct version of Spyder (from the spyder-cf env)?

Also, just in case, Spyder 5.2.2 is now available in the anaconda default channel so maybe you can try to update from Spyder 5.1.5 to 5.2.2 with something like:

 conda update anaconda
 conda install spyder=5.2.2

@anorreyv
Copy link

I did not realize the new version was available. Thank you so much for your response, that fixed it!

@chucklu
Copy link

chucklu commented Sep 3, 2022

@ccordoba12 Thanks for your solution, btw do you know when will Anaconda upgrade Spyder? I wonder if you have communication channel with Anaconda.

@ccordoba12
Copy link
Member

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

@Alejandro58581
Copy link

Hello I have problems when I try to update spyder using

conda update anaconda
conda install spyder=5.2.2

image
I already uninstall and install anaconda but the problem is there. I have the same problem with the input instruction and spyder crashed

@stmtgm
Copy link

stmtgm commented Sep 4, 2022

@dalthviz 's update lines of code works for me! Thanks!

@mertsener1
Copy link

@dalthviz Thank you so much!!

@kmoreti
Copy link

kmoreti commented Sep 15, 2022

In order to have spyder upgraded from 5.1.5 to 5.3.3 I updated anaconda, removed spyder, and then installed it again.

conda update anaconda
conda remove spyder
conda install spyder

@chucklu
Copy link

chucklu commented Sep 15, 2022

@kmoreti Maybe anaconda does not support spyder 5.3.3, as it only remind to to upgrade spyder to 5.2.2 . You might test 5.3.3 on anaconda , and give feedback here.

@kmoreti
Copy link

kmoreti commented Sep 15, 2022

@chucklu, I received the reminder to upgrade to spyder 5.3.3, that's why I tried that specific version.
Given that the issue described here was fixed at version 5.3.0 (#17616 (comment)), I thought it could be helpful to describe how to get it working.
As I mentioned, I had spyder upgraded successfully with the steps above.

@dalthviz
Copy link
Member

Hi all, just in case, as @kmoreti mentioned I think Spyder 5.3.3 is now available from the default anaconda channel (https://anaconda.org/anaconda/spyder/files?version=5.3.3)!

However, seems like the conda solver has a rough time when trying to move Spyder to version 5.3.3 (could take a good a mount of time and fail due to conflicts, probably due to the anaconda package missing a new release too) so I guess that's why uninstalling and then installing worked for @kmoreti with the steps mentioned at #17616 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests