Spyder: Error occurred while starting the kernel - python

I am getting this error message in my Spyder console:
This happened after I changed the Python interpreter to my python 3.8 exe file since my Anaconda/Spyder was using 3.7. I tried to use conda install spyder-kernels in my anaconda prompt but it said that All requested packages already installed. Any way to fix this?

Related

Cannot change jupyter python version after installing python 3.10.6

I did a default installation of Python 3.10.6 from official website in order to use some updated features of package 'math'. While the installation is successful, by printing the sys.path in Jupyter it keeps showing that the currently active version is 3.7.1. The same situation occurs in conda prompt, when I check the version by entering the following command.
(base) C:\Users\p'c>python --version
Is their any way to solve this?

Why is Miniconda not running the latest version of Spyder?

I am in my tensorflow env on my minicoda prompt and I have just installed the latest version of Spyder via the following prompt: conda update spyder. Before I updated spyder I was on v4.1.3. I then searched to see if it was installed correctly with the following prompt: conda search -f spyder which brought up this list:
However, when I run spyder from miniconda: spyder (or even startup the application by clicking on the icon) it still launches my previous version of 4.1.3
What I then tried to do was run the prompt spyder=5.05 but it still launches version 4.1.3.
In my miniconda3\Lib\site-packages directory my spyder folder's file __init__.py has version = 4.1.3 so I understand that that is why it is launching 4.1.3. I do not know why this spyder folder was not updated. You can also see the pkgs folder there is only Spyder v4.1.3
Can someone please help me get the latest version of spyder to run without me having to uninstall and reinstall it, as I have all my preferences set on spyder and apparently there is no way of exporting and then importing them. Thanks
In my environment on my Miniconda prompt I typed in conda install spyder=5.0.5 and this resolved the issue. I now have Spyder 5.0.5! Acknowledgements to MB-F for giving the solution in the comment section.
Try to do it in this order:
conda update anaconda
and then
conda install spyder=5
this will allow you to successfully upgrade to version 5.
If it didn't help, then do this:
conda install conda-forge::spyder[version='>=5.0.0]
You can put another version

An error occurred while starting the kernel in Spyder

I have been trying to get my Spyder console to stop this error on my Mac Big Sur. I am not sure if there an issue with the version and interpreter I am using, but I am not sure how to switch to another version or have the correct version.
Your Python environment or installation doesn't have the
spyder‑kernels module or the right version of it installed (>= 2.0.1
and < 2.1.0). Without this module is not possible for Spyder to create
a console for you.
You can install it by running in a system terminal:
conda install spyder‑kernels=2.0
or
pip install spyder‑kernels==2.0.*
I have tried both commands in terminal but they fail to download

Unable to start jupyter notebook in visual studio code

I am trying to make a jupyter notebook in visual studio code but I keep getting this:
''Unable to start session for kernel Python 3.8.3 64-bit ('Lenovo':
virtualenv). Select another kernel to launch with.''
I have anaconda installed and the jupyter notebook works fine in the anaconda navigator. I also tried to use python 3.8.3 base:'conda' but it didnt work. I'm using windows 10
This issue also occurs on my computer. The solution is to restore the version number of a dependency package "traitlets" of ipython kernel to 4.3.3.
You could try to use "pip list" to view the version of the module "traitlets" in the current virtual environment. If it shows version 5.0, it is recommended that you use version 4.3.3.
You could reinstall "traitlets 4.3.3" with the following command:
python -m pip install 'traitlets==4.3.3' --force-reinstall
If this command is not available, you could use 'pip' to uninstall traitlets5.0 (pip uninstall traitlets) and then use 'pip' to install traitlets4.3.3.(pip install traitlets==4.3.3)
Reference: Unable to start session for kernel Python.
I had the exact same problem. Fix it by uninstalling the Python extension that is linked to that error message.
If you are using conda to manage your Python environments, activate your target environment at a command prompt, then enter the following:
$ conda install traitlets=4.3.3
This solved the problem for me.

Problem installing tensorflow in virtual environment

This issue in some form has come up before, however I am having a variant of this issue.
I had python 3.8 installed. Tensorflow does not have a version for this python.
I therefore installed python 3.7 and set up a virtual environment using virtualenv.
In visual studio code I even updated the settings json "python.pythonPath": to the correct path for version 3.7 of python.
I install the correct version of tensorflow using the correct link for 3.7 on the site:
'''pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.1.0-cp37-cp37m-manylinux2010_x86_64.whl'''
But i still get the error
"ERROR: tensorflow_cpu-2.1.0-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform."
When i type python -V I still get Python 3.8.1, could this mean I am not correctly using the virtual environment?
However I have now set up virtual environment using anaconda which is limited to 3.7 and it still says 3.8 when using "python -V" and i get the same error when trying to install.
You can try to either reinstall anaconda, visual studio, or type in the command "pip install --upgrade tensorflow". This should work without the link.
After creating the virtual environment you need to activate it if you haven't already. Once you do, your command line prompt should indicate that a new version of Python, in your case 3.7 is now running.
I ended up using Anaconda with Python 3.6, it seems tensorflow would not work for 3.7 on windows.

Categories