I'm trying to run my project from Google Colab but I keep on getting ModuleNotFoundError: No module named 'miner_config'. The structure of my project is:
import time
import hashlib
import json
import requests
import base64
from flask import Flask, request
from multiprocessing import Process, Pipe
import ecdsa
from miner_config import MINER_ADDRESS, MINER_NODE_URL, PEER_NODES
node = Flask(__name__)
This is the error:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-27-9f096205089b> in <module>()
8 import ecdsa
9
---> 10 from miner_config import MINER_ADDRESS, MINER_NODE_URL, PEER_NODES
11
12 node = Flask(__name__)
ModuleNotFoundError: No module named 'miner_config'
Related
I got a problem I can't seem to figure out. The first time I imported Spacy into a Jupyter notebook I had no problems. It just imported it as I expected.
import spacy
nlp = spacy.load('en_core_web_sm')
i tried
import sys
print(sys.executable)
and i got this error
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-21-e4c801bd61f2> in <module>
----> 1 import spacy
2 nlp = spacy.load('en_core_web_sm')
~/Downloads/PREFIX=/home/khbe0387/anaconda3/lib/python3.8/site-packages/spacy/__init__.py in <module>
9
10 # These are imported as part of the API
---> 11 from thinc.api import prefer_gpu, require_gpu, require_cpu # noqa: F401
12 from thinc.api import Config
13
ImportError: cannot import name 'prefer_gpu' from 'thinc.api' (/home/khbe0387/Downloads/PREFIX=/home/khbe0387/anaconda3/lib/python3.8/site-packages/thinc/api.py)
I am using Google Colab python 3, when import from python.aux.plot import choose_proj_from_xar i got error ModuleNotFoundError
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import xarray as xr
from matplotlib import animation, rc
from IPython.display import HTML
from python.aux.plot import choose_proj_from_xar
from python.aux.ml_flood_config import path_to_data
from python.aux.plot import Map
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-42-e570b5b49079> in <module>()
from IPython.display import HTML
---> from python.aux.plot import choose_proj_from_xar
from python.aux.ml_flood_config import path_to_data
from python.aux.plot import Map
ModuleNotFoundError: No module named 'python'
how to resolve this issue ? Thanks!
I am using jupyter nb running python 3.9.1 using pip to install modules etc.
All imports work smoothly except missingno.
All the modules being imported are located in the same location Python39\lib\site-packages but missingno results in Import Error.
The missingno module had been imported and it has run smoothly before but after a kernel restart, the Import Error cropped up.
ImportError Traceback (most recent call last)
<ipython-input-16-fad26a6fb4fe> in <module>
6 #Visualization
7 import matplotlib.pyplot as plt
----> 8 import missingno
9 import seaborn as sns
10 plt.style.use('seaborn-whitegrid')
~\AppData\Local\Programs\Python\Python39\Lib\site-packages\missingno\missingno.py in <module>
6 import seaborn as sns
7 import pandas as pd
----> 8 from .utils import nullity_filter, nullity_sort
9 import warnings
10
ImportError: attempted relative import with no known parent package
How to fix it?
I have tried to delete the missingno files and reinstalling it using pip install missingno but nothing works.
Running Python in shell and importing missingno, I still get the same error. There is nothing fancy in my code, a simple, generic import which showed no signs of error before kernel restart.
>>> import missingno
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\OK\AppData\Local\Programs\Python\Python39\Lib\site-packages\missingno\missingno.py", line 8, in <module>
from .utils import nullity_filter, nullity_sort
ImportError: attempted relative import with no known parent package
Try opening the missingno.py file in site-packages.
Change
from .utils import nullity_filter, nullity_sort
to
from utils import nullity_filter, nullity_sort
A few days ago Folium was working perfectly, but now it's not working. The problem:
import folium
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-10-173c1173bf1c> in <module>
----> 1 import folium
~\folium.py in <module>
13 from branca.element import CssLink, Element, Figure, JavascriptLink, MacroElement
14
---> 15 from folium.map import FitBounds
16 from folium.raster_layers import TileLayer
17 from folium.utilities import _parse_size, _tmp_html, _validate_location
ModuleNotFoundError: No module named 'folium.map'; 'folium' is not a package
Even installing by pip and conda doesn't matter library.
I am trying to import following in jupyter notebook.
How do I import module Support_funcions?
from support_functions import calculate_accuracy, plot_confusion_matrix
Populating the interactive namespace from numpy and matplotlib
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-3-d809bed20d2c> in <module>
20
21 # Support functions import
---> 22 from support_functions import calculate_accuracy, plot_confusion_matrix
ModuleNotFoundError: No module named 'support_functions'
Make sure setup is correct for Python. Add the file for support_functions (support_functions.py question) to the systems python._pth file.