I am trying to use a Jupyter notebook for some Pandas in VS Code. I set up a virtual environment venv where I installed Pandas and jupyter. I always did it like this and it worked fine. But suddenly it does not work anymore. Code with error message
9 Answers
I got the same error message because the jupyter package was missing in my selected environment.
pip install jupyter
resolved the problem for me.
From the official VS Code documentation:
To work with Python in Jupyter Notebooks, you must activate an Anaconda environment in VS Code, or another Python environment in which you've installed the Jupyter package.
- 301
 - 2
 - 4
 
- 
                    This worked for me on Windows laptop. Thanks for suggestion. – user3761555 Jan 03 '23 at 00:25
 
Could you try to reinstall the pyzmq module?
pip uninstall pyzmq
pip install pyzmq==19.0.2
- 7,438
 - 1
 - 5
 - 13
 
- 
                    1Get the reason why this is the answer from another answer [here](https://stackoverflow.com/a/72937056/11671779). – Muhammad Yasirroni Nov 16 '22 at 01:06
 
Update to Steven-MSFT's solution:
pip uninstall pyzmq        #Steven-MSFT's solution
pip install pyzmq==19.0.2
pip install pyzmq          #Update
Explanation:
Installing 19.0.2 (after uninstalling) produced an error ..
jupyter-client 7.3.4 requires pyzmq>=23.0, but you have pyzmq 19.0.2 which is incompatible.
.. updating pyzmq to the latest version (23.2.0 at time of writing) by running pip install pyzmq resolved this error. I was originally on the latest version, so i'm not sure why this procedure of reverting and then reupgrading works ¯\(ツ)/¯
- 99
 - 1
 - 10
 
Unfortunately I tried some options previously provided but none of them worked.
pip install pyzmq==19.0.2 
pip install jupyter
Only thing that worked was to go to the Jupyter extension in VS CODE and change from Release Version to Pre-Release version and reload the program.
- 329
 - 4
 - 5
 
I faced a similar problem for the last couple of days and tried almost all the solutions available including the following
- Re-installing 
conda,python,jupyter, VS-code. - Updating 
pyzmqand many other suggested packages and dependencies. - Trying running on a local server (which worked but was not what I was looking for)
 
Finally what worked was simply switching the Jupyter extension in VS Code to the Pre-release version. Jupyter Extension
- 41
 - 3
 
A workaround would be to run the kernel in a separate terminal (using the jupyter notebook command), and to connect to that kernel from VS Code (Click on "Jupyter Server: local" and choose the kernel running on localhost from the list).
- 46
 - 2
 
Building off the work of @Steven-MSFT and @Con O'Leary, try:
pip install --upgrade pyzmq
This upgrades the pyzmq package. As @Con O'Leary notes, recent versions of jupyter-client require more more recent versions of pyzmq.
- 352
 - 1
 - 3
 - 16
 
I clicked in extensions, selected Jupyter, and there was a reload button behind it. It worked after I clocked it.
- 51
 - 2
 
- 
                    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 22 '23 at 13:05
 
I tried a lot of things but the only thing that worked was switching to a pre-release version of jupyter in the extensions tab and reloading.
