Folium Problem: "No module named 'folium.map'; 'folium' is not a package" - python

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.

Related

ImportError loading spacy in jupyter notebook(ubuntu)

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)

Python "Import missingno" results in "ImportError: attempted relative import with no known parent package"

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

from simpletransformers.language_modeling import LanguageModelingModel NOT WORKING

I have installed simpletransformers with success. Why is it not working? A big thank you in advance.
from simpletransformers.language_modeling import LanguageModelingModel
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-9-eb4f4fd6459f> in <module>
----> 1 from simpletransformers.language_modeling import LanguageModelingModel
~\anaconda3\lib\site-packages\simpletransformers\language_modeling\__init__.py in <module>
----> 1 from simpletransformers.config.model_args import LanguageModelingArgs
2 from simpletransformers.language_modeling.language_modeling_model import LanguageModelingModel
~\anaconda3\lib\site-packages\simpletransformers\config\model_args.py in <module>
6 import warnings
7
----> 8 from torch.utils.data import Dataset
9
10
ModuleNotFoundError: No module named 'torch'
I answered my own question with "pip install torch" and updated the Microsoft C++ reading software. :)))

ModuleNotFoundError: No module named 'support_functions'

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.

Import error in ipython for AplPy

I am trying to start up AplPy on OSX by importing it on ipython.
I installed AplPy using pip, and then in the terminal I entered:
ipython --pylab
import aplpy
However I only get the following output:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/kernel/_
_init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated.
You should import from ipykernel or jupyter_client instead.
"You should import from ipykernel or jupyter_client instead.", ShimWarning)
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-429eb0b27113> in <module>()
----> 1 import aplpy
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/aplpy/__init__.py in <module>()
12 if not _ASTROPY_SETUP_:
13
---> 14 from .core import FITSFigure
15 from .rgb import make_rgb_image, make_rgb_cube
16
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/aplpy/core.py in <module>()
12
13 import matplotlib.pyplot as mpl
---> 14 import mpl_toolkits.axes_grid.parasite_axes as mpltk
15 from astropy.extern import six
16
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpl_toolkits/axes_grid/__init__.py in <module>()
2 unicode_literals)
3
----> 4 from matplotlib.externals import six
5
6 from . import axes_size as Size
ImportError: No module named externals
I couldnt find anywhere online a module named externals that could possibly be missing, would anyone else have any idea what's going on?

Categories

Resources