env.render() in Jupyter Notebook hangs up [duplicate] - python

I´m trying to run some code using Jupyter and I can´t find a way of installing gym.
This is the code:
!pip install gym==0.18
import gym
After all the "Requirement already satisfied"s (since I had already installed it) it says:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Input In [2], in <cell line: 2>()
1 get_ipython().system('pip install gym')
----> 2 import gym
ModuleNotFoundError: No module named 'gym'
The same happens if I don´t specify a version, and use only "gym".
I tried installing it using Terminal several ways, however, this shouldn´t be so complicated, right?
Please help.
Thanks in advance.

Related

error then import pytorch-lightning, azure notebook

i am use microsoft azure (for students) ML servise. Then i work with notebook i can not import pytorch-lightning libary.
!pip install pytorch-lightning==0.9.0
import pytorch_lightning as pl
Here i have error:
ModuleNotFoundError Traceback (most recent call last)
Input In [1], in <module>
----> 2 import pytorch_lightning as pl
ModuleNotFoundError: No module named 'pytorch_lightning'
This is unbearably weird. someone faced such a problem?
This is rather strange but could be related to that your installation is in another location, so let's:
try where is PL installed with find -name "lightning"
also, check what is the loaded package locations python -c "import sys; print(sys.path)"
I guess that the problem will be in What's the difference between dist-packages and site-packages?
I resolved this problem by installing PyTorch-lightning in the kernel instead of the machine. It all boils down to installing with %conda magic instead of !conda magic (or same thing for %pip magic instead of !pip magic).

ModuleNotFoundError: No module named 'pyaudio' in Google Colab

I imported 'pyaudio' library in Google Colab, but ModuleNotFoundError occurs.
However, it worked just a week ago... :( But does not Now..
I tried to re-install pyaudio in colab with the next codes but same errors occur.
!sudo apt-get install python-pyaudio
!pip install pyaudio
How can I do?
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-13-627d880c2452> in <module>()
4 from pydub.effects import normalize
5
----> 6 import pyaudio
7 import scipy.signal
8
ModuleNotFoundError: No module named 'pyaudio'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Could not able to provide requirement.txt in paperboy?

I have installed paperboy from:
https://github.com/timkpaine/paperboy
I am trying to execute notebook with dependancy in requirement.txt
I have executed paperboy using
python -m paperboy.server --backend='sqla' --auth='sqla' --scheduler='airflow'
my requirement file:
cv
while executing its throwing error:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-91a2ffa00be2> in <module>
----> 1 import cv
ModuleNotFoundError: No module named 'cv'
As per paperboy source code, there is a function create_virtualenv uses requirements.txt file and create a virtual environment.
But this function has never been called.
Do anyone knows how to fix this?
Thank you...!

Jupyter notebook error ModuleNotFoundError: No module named 'datascience'

Good evening,
I am trying to import datascience module at my Jupyter notebook, but the notebook keeps showing error called
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-10-6f3a305c96af> in <module>()
----> 1 from datascience import *
ModuleNotFoundError: No module named 'datascience'
although I have done
pip install --user datascience
Could anyone solve this problem for me?
Thank you in advance
first, check whether you have installed datascience package in to the same environment.
use pip freeze to list installed packages.
if it's installed correctly, then try this.
import datascience as dt
then you can access ant function in datascience package.
`dt.function()`
Perhaps these links can help you :
link, link 2 and link 3
First, activate your environment if you have it.
Second, check your project path.
Third, try to install your package one more time.
Fourth, use freezing to check if a module is installed.
Five, check if the import is well done.

cnn_utils module missing from Google Colab

I'm trying to run a copy of a notebook from my Coursera class (which is in Jupyter) in Colab and getting an error:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-6-1ee14f68a167> in <module>()
8 import tensorflow as tf
9 from tensorflow.python.framework import ops
---> 10 from cnn_utils import *
11
12 get_ipython().magic('matplotlib inline')
ModuleNotFoundError: No module named 'cnn_utils'
i tried doing !pip install but it yelled at me again:
Could not find a version that satisfies the requirement cnn_utils (from versions: )
No matching distribution found for cnn_utils
anyone know how to fix it?
cnn_utils here is just a personal library for the course, not a public module. You cannot install it with pip install.
You need to find the source of cnn_utils.py then download that to your computer, then upload it to Colab.
here is the cnn_utils.py from coursera course

Categories