How can I solve the Import error for scraping - python

Unable to solve the error.
All the code is taken from the website, but it's not working.
This working environment is jupyter notebook because I tried to work at IDLE in desktop, but it was not worked.
I've tried to install scraping in my computer and succussed.
But still the error is not deleted.
Error messages:
ModuleNotFoundError Traceback (most recent call last)
Input In [5], in <cell line: 5>()
2 get_ipython().run_line_magic('autoreload', '2')
4 from datetime import datetime
----> 5 from scraping import Scraping
6 from complete import Complete
7 from train import Tree_updown, Tree_updown_k
ModuleNotFoundError: No module named 'scraiping'
Code that is generating the error:
%load_ext autoreload
%autoreload 2
from datetime import datetime
from scraping import Scraping
from complete import Complete
from train import Tree_updown, Tree_updown_k

The error says, No module named 'scraiping' but in your code you correctly imported scraping. So I suppose you just entered a typo while copying the error.
To fix it you just have to install the package. Type this in your terminal:
pip install scraping

Related

Error importing gym using Jupyter Notebook

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.

ImportError: cannot import name 'RasaNLUConfig' from 'rasa_nlu.config' in Google Colaboratory

I'm trying to make a NLU model. When I run
from rasa_nlu.config import RasaNLUConfig
I get an error:
ImportError Traceback (most recent call last)
<ipython-input-1-c2bca1b53b6f> in <module>
----> 1 from rasa_nlu.config import RasaNLUConfig
2 from rasa_nlu.model import Trainer
ImportError: cannot import name 'RasaNLUConfig' from 'rasa_nlu.config' (/usr/local/lib/python3.7/dist-packages/rasa_nlu/config.py)
I thought, "Meh,not a big issue, Colaboratory just hasn't got Rasa installed by default, I'll just install it".
So when I installed it with !pip install rasa_nlu, it did everything, and then it told me to restart the runtime and gave me a button to do that. I did that, then I ran from rasa_nlu.config import RasaNLUConfig and I still get the same error:
ImportError: cannot import name 'RasaNLUConfig' from 'rasa_nlu.config'
I am not familiar with !apt so I don't know how I'm supposed to install Rasa with that. Will the problem be solved with that? Or is it something else?
Looks like I was using a newer version of rasa_nlu (0.15.1). The tutorial I was following used 0.11.3. In 0.11.3, RasaNLUConfig was located at from rasa_nlu.config. But in 0.15.1, it was someplace else.
So... that's solved!

Python/Jupyter Notebook Not finding modules...?

I just got done writing a pretty good rock paper scissors game and now when I try to import it and run the cell I'm getting this:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-7-8d3be5084430> in <module>
----> 1 import RPSgame.py
ModuleNotFoundError: No module named 'RPSgame.py'; 'RPSgame' is not a package
What is causing this and how can I fix it? I'm running Jupyter Notebook through Anaconda Navigator
It might be related to how you are importing the .py file
This link might help: How to import other Python files?
You shall try this:
import .RPSgame

Databricks job cannot find python library imported in the cluster

I am trying to run a cron job on my notebook and I get an "no module found" error. When I look at the job logs this is the full error:
ModuleNotFoundError Traceback (most recent call last)
<command-2307930105977041> in <module>
1 from __future__ import print_function
2 import sys
----> 3 import pymysql
ModuleNotFoundError: No module named 'pymysql'
This library has been installed to my cluster that I am running the job from and the notebook that uses this library runs and does not show a ModuleNotFoundError. I ran the import pymysql in it's own cell and it does not throw me back an error, only when I run a job on that notebook do I get an error.
What can be the cause for this?

How to Import linear_algebra Python Jupyter Notebook

I am having some difficulty trying to get the linear_algebra module working on Jupyter Notebook in Python. I am trying:
import linear_algebra
But I get the following error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-30-7080be6cdc0f> in <module>()
----> 1 import linear_algebra
ImportError: No module named 'linear_algebra'
I don't get what I am doing wrong
Thank you in advanced for help
The 'linear_algebra' is not a library so you can't simply import it as such. It is a file that has the functions (eg. dot) so you have to make sure your main code file and the linear_algebra.py is at the same directory. I hope this helps.

Categories

Resources