Error in Python 3.9.12 while using input command - python

I am using spyder in anaconda to run my python program (added the figure below to show my version ) .
When I type input() command in editor window, an error pops up .
(above)I have attached the screenshots of the same.
If I retain first part alone, there is no error.
Can someone help me as to why this error pops up.
I reinstalled the anan conda several times, thinking it was an installation error

I think its a bug in anaconda-spyder which a lot of users have reported. I suggest one of the two appraoches :
Install 'non-anaconda' distribution of python and do pip install spyder.
Or check if your anaconda version is 5.1.5, if yes then check this - link or downgrade spyder or search other relevant links.

Related

can't get textpad.textbox library to install

For the past few days I've been trying to download the textbox module for curses.textpad. Every attempt has failed (trying to do it on windows with Pycharm). Tried the pip command in CMD, downgrading python versions, but I always end up in a dead end. Searching it online wasn't much help. there's this one site (https://pypi.org/project/textbox/) but I believe it's a guide for the raspberry pi.
Is there a way to get it to work on windows 10 and if yes, how?
thank you in advance!
tried:
pip install in CMD (pip install textbox), downloading and upgrading Microsoft build tools as that was returning an error, downgraded python to 3.6.4 and downloaded rust as it was returning another error. For other details I'll try to be active in the comments
EDIT:
I apologize. I used textbox instead of Textbox so that was causing the error.

Open Jupyter in VSCode: TypeError: Cannot read properties of undefined (reading 'makeSettings')

System: MacOSX 10.15,
VSCode Version: 1.67.2,
Python Kernel Version: 3.8.13 (Conda base).
I created a new Jupyter notebook in my VSCode using command shortcut and selected the right python kernel showed above. The empty notebook page is well loaded and no error message occurred.
But when I typed and ran any code in the cell, this error message showed up below the cell.
Then I clicked the "log" link and the error log showed up and it was like this:
And hence I couldn't run any code in the notebook cell. Then I changed to another Python Kernel (3.9.12) of the same notebook, it showed the same error message:
Please give me a solution to overcome this bug.
Update: I tried to reinstall pyzmq to an older version in the canda base environment and it didn't change anything. Then I typed command jupyter --version and everything is well installed.
Update: I have searched on Github Issues of VSCode. There are two similar issues that are all caused by some extensions, one is called "Gitduck"(now renamed "duckly"), the other is "nur.Script". The link to these issues are here:
Cannot read property 'makeSettings' of undefined #834
Cannot read property 'makeSettings' of undefined #128458
But unfortunately, I never have installed any of these extensions in my VSCode. So it may be caused by a similar extension but I still don't know the name.
Finally, I use the command code --list-extensions to list all my installed extensions here, maybe helpful for filtering which extension is the bad guy:
Final Update: Today (05/31) I opened VSCode and tentatively created an empty Jupyter notebook, and this problem has gone away. I have done nothing, maybe VSCode's auto-update has solved this problem. Case closed.
You can try reinstalling the pyzmq module.
pip uninstall pyzmq
pip install pyzmq==19.0.2
Hope this helps you.

IPython console in spyder extremely slow in Anaconda

I'm trying Anaconda/Spyder after using the standard python installation/IDLE for several years. The console (and variable explorer) becomes progressively slower during each work session, with every script and interactive command that I run. Eventually it takes minutes to get a response to simple commands like print, and then it stops responding completely and I shut it down. It's pretty disruptive to my work.
Mac OSX 10.13.6
conda version : 4.5.11
conda-build version : 3.15.1
python version : 3.7.0.final.0
qt 5.9.6
spyder 3.3.1
ipython 7.1.1
I do use matplotlib frequently. Whenever possible I use plt.ioff() at the beginning of a script and/or plt.close('all') at the end. Turning off matplotlib support completely in preferences doesn't help and it's not a permanent fix anyway. Python is not using anywhere near all my CPU or RAM.
As far as I've found out, the problem seems to be with the latest major release of the ipython kernel. Pinning the version of ipykernel to 4.10.0 solved it for me. To do so, add a line containing ipykernel 4.* to the file ~/anaconda3/conda-meta/pinned. Create the file if it does not exist yet. Then conda update ipykernel which will actually downgrade to 4.10.0. Worked for me!
you don't need to downgrade the entire spyder.
For me it worked with downgrading these two:
conda install ipython=6.4.0
conda install ipykernel=4.10.0
So this is not a totally satisfying solution but it seems to be a reasonable temporary fix. If you downgrade your spyder version to 3.1.X you will be able to use the python console rather than the Ipython console, and this seems to work for me. To do this just run:
conda install spyder=3.1
in the terminal while your environment of choice is active. This is not ideal, because the developers removed the python console for a specific reason as mentioned in this question, How to add python console in spyder.
Additionally downgrading this much may have unforeseen effects on other packages your code uses and may cause other issues but so far this is the only solution I was able to come up with.
#Sjoerd Thanks for your answer, this is what worked for me. To be still clearer, here's what I did in terminal on Anaconda 3 on High Sierra:
echo "ipykernel 4.10.0" >> ~/anaconda3/conda-meta/pinned
conda update anaconda
When I tried to update only ipykernel, I would have dependencies errors. By updating anaconda, everything is now up to date but ipykernel which is effectively at version 4.10.0. I didn't experience any hang since then.
#JJR4's answer didn't work for me (seems to work for others). Another workaround is to type %connect_info magic command into the IPython Spyder console which will display the JSON info to connect another console to the kernel.
The output of the magic command explains how to connect, but basically there are three options.
Paste the above JSON into a file, and connect with:
$> jupyter <app> --existing <file>
or, if you are local, you can connect with just:
$> jupyter <app> --existing <kernel>.json
or even just:
$> jupyter <app> --existing
if this is the most recent Jupyter kernel you have started.
I typically use qtconsole as the app. Once you enter your chosen connection method into the command line, a new console will open that is connected to the same kernel as the console in Spyder. For some reason, the new console does not lag even if the Spyder console does.
Enter everything in the new console, even runfile()
Hope this helps!
UPDATE:
Downgrading to ipykernel version 4.10 seems to solve the issue for me. Thanks to Carlos Cordoba - see GitHub conversation in link below.

Downgrade to previous version of Spyder

I'm currently using the Anaconda package with Python 2.7.9-1
Yesterday I upgraded the Spyder-app via the Anaconda Launcher and all of my scripts now crash. (Some bugs are already reported in the issues page https://github.com/spyder-ide/spyder/issues).
How can I downgrade to the previous Spyder version meanwhile those bugs are fixed?
You can install a specific version of spyder with conda. For instance, to install 2.3.5.2, run
conda install spyder-app=2.3.5.2
in the terminal.
In Anaconda Navigator, on Spyder tab, you have a settings symbol on top right corner. Press that and select 'Install specific version' option
Thanks for the answers.
What worked in the end was the following (I have windows 7 and the Anaconda Package):
1) In the anaconda prompt, type:
conda list -r
this is going to give you a list of all the packages updates you've done in the past.
2) Check the number of the update where you had the previous version of spyder (for example in my case was 2015-06-25 10:43:34 rev 4) and type:
conda install --revision=4
It would ask you if you want to downgrade, etc and thats it!
Now all scripts run again.
The previous answers didn't work for me, but going here: (https://docs.spyder-ide.org/installation.html). I found the following command works.
conda install -c conda-forge/label/beta spyder=4.1.3
or
conda install spyder=4.1.3*
Note: I had to do this today (7/17/20) where the most recent version is spyder=4.1.4 and I'm getting the following error in the console: "QSocketNotifier: Multiple socket notifiers for same socket 2068 and type Read"
As it is hosted on GitHub, you can find the desired version from the commit history and download that version easily.
First browse the commits:
https://github.com/spyder-ide/spyder/commits/master
After you find the version that doesn't break things. Then you can easily download and install it.
As mentioned before there is an option in the GUI now to select the preferred version.
But before that make sure to run conda update conda. At least in my case that helped.

"tput: Unknown terminal 'emacs'" messages when using PyCharm / iPython console on Windows

I am using PyCharm with iPython on Windows. The only Python I have installed on the box is the latest Anaconda distribution, Python 3.4 flavor.
Very often, while using the console, I get numerous instances of the following warning message:
tput: unknown terminal "emacs"
This is mixed in with the normal output. Has anyone else experienced and/or fixed this? I have dug through both the iPython and PyCharm documentation and have not found anything related.
Did you install anything new recently?
Check your path for anything "unixy", for example I removed ...\Git\bin from my path and it solved the problem for me.

Categories