I'm attempting to run a very simple tqdm script:
from tqdm.notebook import tqdm
for i in tqdm(range(10)):
time.sleep(1)
but am met with:
IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
My ipywidgets is v8.0.4 and jupyter v1.0.0... does tqdm not work anymore with VS Code Jupyter Notebook?
Related
I am trying to import tifffile in jupyter. When I do
import tifffile
print(tifffile.__file__)
I get
/home/user/anaconda3/envs/myenv/lib/python3.7/site-packages/skimage/external/tifffile/__init__.py
However, when I run the same command in ipython, same conda environment, I get
/home/user/anaconda3/envs/myenv/lib/python3.7/site-packages/tifffile/__init__.py
How is this possible?? How do I make it so they both import the second one?
fig.write_image("images/fig1.png",format='png',engine='kaleido')
This makes my VSCode go bananas, the terminal hangs and the program stops then and there. Everything works fine if I remove just that line.
I want to save the plots as pngs, but it is not working. I have kaleido installed.
Try this version of kaleido.
pip install kaleido==0.1.0post1
It works for me
Complete MWE. png gets created as expected.
import plotly.graph_objects as go
import numpy as np
from pathlib import Path
f = Path.cwd().joinpath("images")
if not f.is_dir(): f.mkdir()
f = f.joinpath("fig1.png")
fig = go.Figure(go.Scatter(x=np.linspace(1,10,100), y=np.sin(np.linspace(-np.pi,np.pi, 100))))
fig.write_image(f,format='png',engine='kaleido')
versions
import plotly
import kaleido
print(plotly.__version__, kaleido.__version__)
5.5.0 0.2.1
Please follow what Gillian Grayson suggested. I am using Jupyter Notebook, Plotly version 5.13.0 and Kaleido 0.1.0.post1 and Python 3.8
Also add this to make saving figure faster
import plotly
plotly.io.kaleido.scope.mathjax= None
I am facing an error which I do not know how to fix. I'm trying to get this piece of code to work on windows but I have this error appearing
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.plot()
Error: "The kernel appears to have died. It will restart automatically."
I just had the same error message appear while using Jupyter notebook. Based on what I read, I think it's suggested to reinstall pandas, NumPy and matplotlib (other libraries if necessary) and see if that works.
I had several other issues, so I reinstalled the Anaconda navigator.
You can just use py script instead of Jupyter but if you wanna use Jupyter try either reinstalling NumPy or update.
pip install -U numpy
I am trying to run gym in headless server and render the same in jupyter. Python version 2.7.
I have started the jupyter using xvfb-run -a -s "-screen 0 1400x900x24" jupyter notebook
Below is the Jupyte cell that I run.
import matplotlib.pyplot as plt
import gym
from IPython import display
%matplotlib inline
env = gym.make('CartPole-v0')
env.reset()
plt.imshow(env.render(mode='rgb_array'))
display.display(plt.gcf())
display.clear_output(wait=True)
env.step(env.action_space.sample()) # take a random action
env.close()
But the error I get is as below :
AttributeError: 'ImageData' object has no attribute 'data'
I have searched a lot in forums but could not find a solution. Thanks in advance to help me fix this error and make me to render gym in jupyter notebook.
I encountered the same issue. Installing pyglet-v1.3.2 instead of v1.4.1 solved the issue for me.
I have python 3.7 and for my upgrading to gym 0.18.2 solved the problem (with pyglet 1.5.5)
For what it's worth, like #patapouf_ai I upgraded from gym 0.9.6 to gym 0.19.0 and this solved the problem. It seems the root issue is that mode=rgb_mode returned error when passed into env.render.
I am using numba to speedup my code. It runs fine in the terminal. But when I try to run it inside jupyter notebook, it gives error for import numba prange. I am using Numba 0.38.1.
When I try import prange from the temrinal of jupyter, the import works fine.
Can someone please guide me what could be the issue. Thanks
From the terminal created from Jupyter
From the notebook
Can you try the import and operation in different cells?
It worked for me. See here