Jupyter Notebook does not work fully in Pycharm - python

I am following these steps to run IPython in the Pycharm IDE. On pressing run button in any cell, I do get below pop-up window
According to the mentioned guide (given link), On pressing OK, I should get following message
But, I am not getting any type of message/response. So, I am not able to see the output of any cell contents. Does anyone know why I am not getting any response on selecting OK?
System Information:
OS: MAC OS 10.10.3
Python: 2.7.10 using Anaconda 2.3.0
Ipython: 4.0.0
Pycharm: pycharm community addition 2016.2

I solved following:
First I followed the reply to the issue jupyter-notebook No such file or directory: 'conda', in short you should do:
conda update nb_conda nb_conda_kernels nb_anacondacloud
Then, I ran my jupyter notebook in my browser. I took note where the Jupyter notebook was running, i.e.
The Jupyter Notebook is running at: http://localhost:8888/
Then I started a new Jupyter Notebook in PyCharm2016.2.2, and when it asked about the Jupyter Notebook URL I changed the default http://127.0.0.1:8888 to http://localhost:8888/
and finally it worked.

For the PyCharm Jupyter notebooks, to see results you need to open up a jupyter notebook.
The reason why you don't just do all your code in Jupyter Notebooks is because Pycharm helps with LaTex integration and many more functions.

According to this answer:
Jupyter notebook server not working with latest PyCharm 2017.2 update. How do I solve this?
You need a package named ”notebook“. I had the same issue and I solved it by installing the package.

Related

My jupyter notebook refuses to open in VS Code

I use Jupyter Notebooks through my browser but have recently started to use Visual Studio Code for a lot of my coding. I have created a virtual environment and installed pandas, started VScode and tried to run a single line of code and I keep getting this error.
Failed to start Jupyter in the environment 'Python 3.9.5 64-bit (/opt/homebrew/opt/python#3.9/bin/python3.9)'.
View Jupyter [log](command:jupyter.viewOutput) for further details.
I can not solve this and I have no idea where to go to ask for help. Can anyone get me through this?

Anaconda Jupyter Notebook blank page when open

I have already download and installed the Anaconda. However, I have a blank page when I open the Jupyter Notebook. I dont know what happen.
Jupyter Notebook: 6.4.5
MacOs: 12.2.1
I use Google Chrome and solved my problem by reading the official Jupyter Notebook page in the section "Jupyter fails to start".
https://jupyter-notebook.readthedocs.io/en/latest/troubleshooting.html
In my case, one of my Chrome extensions was messing with Jupyter, I disabled them all and reactivated them one by one until I found which one was messing up.

VS Code can't open ipynb file

Have everyone already had this problem, where VS Code keeps loading all the time and won't open a ipynb file? I've tried to use python 3.7 but same problem. Also tried to reinstall both VS Code and Anaconda, no success.
Here is my environment data:
VS Code version: 1.49.0
Python extension version:v2020.8.108011
OS and version: Ubuntu 20.04
Python version (& distribution if applicable, e.g. Anaconda): Anaconda python 3.8.3
Type of virtual environment used: using conda base environment
Value of the python.languageServer setting: "Pylance"
ipython version: 7.16.1
jedi version: 0.17.1
ipykernel version: 5.3.2
I've solved (for now) this problem by downgrading jupyter extension to previous version.
Go to Extension (in the left vertical panel) > select Jupyter > click the down arrow of the Uninstall button > then you get "install another version" tooltip > click it > select other version > reload vscode
In their official GitHub page, they are tracking this issue already. There is also a solution (kind of) right now. You have to maximize the terminal panel below and then restore the panel size (basically max and min with the arrow button). Then the Notebook loads and everything works fine. :D
The workaround was in this comment: https://github.com/microsoft/vscode-python/issues/13901#issuecomment-691625412
Not perfect but at least all the features are there and I can work with my notebooks again :)
I'm facing the same issue after the latest update. You can try importing the notebook by pressing ctrl+shift+p/command+shift+p and run Import Jupyter Notebook.
For me maximizing and resetting the terminal panel didn't work whereas uninstalling and reinstalling the VSCode Python extension solved the problem.
I'm facing the same problem since the last update.
For now, in case you still want to use VSCode, you can 'convert to python script' and run it in interactive mode (right click on the notebook, and choose that).
It doesn't solve the issue, but make it possible currently to use your notebooks in VSCode.
I have the same behavior. Downgrades of Jupyter extension works for me
(screen)
In VS Code, double-clicking just stopped working for me for some reason.
Try right-clicking the *.ipynb file in the VS explorer panel and select 'Open in Notebook Editor'
Download the jupyter Notebook extention in VS code.
and than click the .ipynb file.
After clicking .ipynb file vs code will preview.
enter image description here

How to specify python3 kernel in jupyter in pyCharm?

Here is my setting
and this is my script
I am trying to use jupyter notebook in pyCharm, but it kept using python2 instead of python3.
Any idea about this problem?
Add:
this pic is running jupyter notebook in chrome.
My problem was that I had multiple kernels, and PyCharm launches the default kernel. One approach might be to configure PyCharm to specify the kernel of choice to start up, I didn't investigate how to do that. I simply changed the default kernel in Jupyter and this worked for me (I have a virtualenv for tensorflow). c.MultiKernelManager.default_kernel_name = 'tensorflow'.
The preferences image you show is indeed how you would setup your interpreter for PyCharm, but that's not what the output/logging of PyCharm looks like. I'm guessing that's a jupyter-notebook display, which means you are running into the issue in jupyter-notebook and not PyCharm. So you need to change your setup for jupyter. Based on some quick searching pip install jupyter will install a python 2.7 version of jupyter. Sounds like what you want is
pip3 install jupyter
which will install the python3 version for you. You will likely have to uninstall your current version of jupyter.
When you kick off Jupyter-notebook from within PyCharm there is a configuration which is created. If the configuration is initially 2.7 ( I think it defaults to the current interpreter), and then keep using that same configuration, it wouldn't matter the state of the current project interpreter because it would be using the value saved in the run configuration.
You can modify your run configuration by
Run | Run...
Edit Configurations...
Select your Jupyter Notebook run configuration on the left (here is untitled4)
Make sure the python interpreter is correct here on the right
I was able to start a jupyter notebook like this and get it to output python 3 by doing this. Hope this is what you are needing.

graphs from Altair are not displaying

On Ubuntu x64, I just freshly installed Anaconda 3.
I then installed altair via conda per these directions. Then I run the example code:
from altair import *
population = load_dataset('population')
Chart(population).mark_bar().encode(
x='sum(people)',
).transform_data(filter="datum.year==2000")
The code runs, but nothing happens. I expected a page would open in the browser perhaps, like bokeh does. To be safe, I also ran jupyter notebook in the background and re-running the code - no difference.
Please let me know if there's more information you need about my environment.
Thanks to #cel, I found out the code cannot be run in the iPython console from Anaconda - it needs to be run from a Jupyter notebook.
You have to run jupyter notebook in the terminal, then create a new iPython Notebook. Once the notebook is created, you can run your code interactively from the notebook.

Categories

Resources