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.
Related
I love the way vs code works with jupyter notebooks and WSL 2. However, the only thing stopping me from switching completely is the lack of image rendering from a distributed notebook. When I download a notebook from class, there are sometimes important images displaying flowcharts, diagrams, etc and these do not load on vs code but they do on Anaconda using jupyter notebook there. Any ideas?
Vs Code Jupyter Notebook
anaconda jupyter notebook loaded
I want to use Jupyter Notebooks inside VS Code running within WSL 2. Regular Python works within WSL without a problem, that means the base conda enviroment is connected and I can run .py files. Moreover, I’m able to run the command jupyter notebook which will start the notebook server within WSL exposing the localhost to the Windows system.
However, I want to test the new Jupyter Notebook feature within VS Code, which is not working for me; VS Code shows: Jupyter Server: No Kernel and Python: Not Started (see screenshot below).
My testing machine is:
WSL 2 (using Pengwin distribution) on Windows 20H1 (19041.21)
VS Code 1.41 (having the Python extension installed)
Anaconda
What I did:
Open WSL
Open VS Code in my target directory (code .)
Create a new Notebook file from the command palette Python: Create New Blank Jupyter Notebook
Create dummy print("test")
Run Cell will trigger the warning:
Is there anything I’m missing?
The VS Code insiders actually works out of box with Jupyter notebooks. Just remember to run code-insiders . instead of code ..
Another solution would be, according to this website, start the VS Code in windows, then use WSL 2 as a remote server.
The code installation on wsl2 needs a restart to work properly, I was told by a notification, and in the question's comments you may see people experiencing the same issue(' it's working now. not sure why'). So before looking upon any elaborate solution, just restart code.
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.
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.
I'm using spyder and pycharm for python coding. When I plot something with matplotlib in spyder it shows the result inline in IPython.
With Pycharm IPython plots in a new extra window.
I'm working on Windows7 and with Anaconda Python2.7.
Is it possible to plot in Pycharm inside in the IPython shell?
Not inside the shell; however, you can use an iPython notebook within PyCharm (2016+) for that purpose. PyCharm supports iPython plots when defined within a .ipynb (iPython/Jupyter file format) script.
Here is an example:
Open, or create (as shown) a .ipynb script:
An here is what you get if you code inside a freshly made .ipynb file within PyCharm 2016 or later. Notice the %matplotlib inline, which comes after matplotlib.pyplot import.
PyCharm 2019.1+
In this version of PyCharm several great features to integrate Jupyter Notebooks and PyCharm were added.
First, create a new Jupyter Notebook or open up an existing one.
Second, you can Insert a new cell or you can work on existing cells.
Third, you can Run or Debug a Cell:
Fourth, if you run the cell, the result will be reflected in the right side of the screen.