I installed Colorama into Google Colab.
When I tried to import it, it shows ImportError:
import colorama
ImportError Traceback (most recent call last)
<ipython-input-33-88ec09736251> in <module>()
----> 1 import colorama
2 frames
/usr/local/lib/python3.6/dist-packages/colorama/ansitowin32.py in <module>()
4 import os
5
----> 6 from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL
7 from .winterm import WinTerm, WinColor, WinStyle
8 from .win32 import windll, winapi_test
ImportError: cannot import name 'BEL'
---------------------------------------------------------------------------
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.
How can I get rid from this problem?
Do..
pip install colorama
and its work.
Related
I'm trying to install pycaret==3.0.0 in google colab, But I'm having a problem, the library requires Jinja2 to be installed which I did, but then It finally throws off another error.
ImportError Traceback (most recent call last)
<ipython-input-26-4f8843d24b3a> in <module>()
----> 1 import jinja2
2 from pycaret.regression import *
3 frames
/usr/local/lib/python3.7/dist-packages/jinja2/filters.py in <module>()
11 from markupsafe import escape
12 from markupsafe import Markup
---> 13 from markupsafe import soft_unicode
14
15 from ._compat import abc
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/root/.local/lib/python3.7/site-packages/markupsafe/__init__.py)
This is caused by upgrade in MarkupSafe:2.1.0 where they have removed soft_unicode, try using:
pip install markupsafe==2.0.1
Can you try this. This will install the latest release of pycaret and should take care of all dependencies for you. Just remember to restart the kernel after installation for the install to take effect correctly.
pip install -U --pre pycaret
I am trying to run this tutorial in colab.
However, when I try to import a bunch of modules:
import io
import torch
from torchtext.utils import download_from_url
from torchtext.data.utils import get_tokenizer
from torchtext.vocab import build_vocab_from_iterator
It gives me the errors for extract_archive and build_vocab_from_iterator:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-5-a24e72502dbc> in <module>()
1 import io
2 import torch
----> 3 from torchtext.utils import download_from_url, extract_archive
4 from torchtext.data.utils import get_tokenizer
5 from torchtext.vocab import build_vocab_from_iterator
ImportError: cannot import name 'extract_archive'
ImportError Traceback (most recent call last)
<ipython-input-4-02a401fd241b> in <module>()
3 from torchtext.utils import download_from_url
4 from torchtext.data.utils import get_tokenizer
----> 5 from torchtext.vocab import build_vocab_from_iterator
6
7 url = 'https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-2-v1.zip'
ImportError: cannot import name 'build_vocab_from_iterator'
Please help me with this one.
You need to upgrade torchtext first
!pip install -U torchtext==0.8.0
Currently, version 0.8.0 works with torch 1.7.0 (no need to upgrade torch, torchvision)
Update (sep 2021)
Currently, torchtext is already 0.10.0 and you don't need to upgrade anything.
Update December 2021
!pip install -U torchtext==0.10.0
torchtext.data becomes torchtext.legacy.data
use:
from torchtext.legacy.data import Field, TabularDataset, BucketIterator, Iterator
credit
You can use:
pip install -U torchtext==0.6.0
if 0.8 version is not available
This might help solve your problem:
conda install -c pytorch torchtext==0.8
import audiolabel
import numpy as np
from ultramisc import ebutils as eb
from audiolabel import LabelManager
ImportError Traceback (most recent call last)
<ipython-input-38-2387500242d1> in <module>
4
5 from ultramisc import ebutils as eb
----> 6 from audiolabel import LabelManager
ImportError: cannot import name 'LabelManager' from 'audiolabel' (unknown location)
In [39]:
I'm trying to import LabelManager from the audiolabel package I got using git clone but for some reason there is no way to import LabelManager? I'm not sure why this is the case, because from all the documentation I've seen from audiolabel, they are able to import LabelManager
This error could be caused by multiple reasons...
Have you tried downloading via pip install ?
pip3 install "git+https://github.com/rsprouse/audiolabel.git"
I am getting the following error in Jupyter Note Book when running the code below in Python.
import talib
I get the following
ImportError Traceback (most recent call last)
<ipython-input-20-29b7d6c547d4> in <module>()
4 import numpy as np
5 import tensorflow
----> 6 import talib
7 import _talib
8 import alpaca_trade_api as tradeapi
ImportError: No module named 'talib'
I am running Anaconda on a MAC
I have looked at all of the existing questions on this and found nothing.
When I use the PIP freeze command I see the following library and version
TA-Lib==0.4.17
The folder talib exists in the following path
anaconda3/lib/python3.7/site-packages
I've pip installed folium and get this error when I try to import it in when Im working in my home directory:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-af6e4f19ef00> in <module>()
----> 1 import folium
//anaconda/lib/python2.7/site-packages/folium-0.3.0.dev0- py2.7.egg/folium/__init__.py in <module>()
3 from __future__ import absolute_import
4
----> 5 from folium.folium import Map, initialize_notebook, CircleMarker
6
7 from folium.map import (FeatureGroup, FitBounds, Icon, LayerControl, Marker,
//anaconda/lib/python2.7/site-packages/folium-0.3.0.dev0- py2.7.egg/folium/folium.py in <module>()
13 import json
14
---> 15 from branca.colormap import StepColormap
16 from branca.utilities import color_brewer
17 from branca.six import text_type, binary_type
ImportError: No module named branca.colormap
However, i can import it when I cd to /Library/Python/2.7/site-packages.... What gives?
Did you install the package with Anaconda? It looks like it's reading the package from Anaconda python's package install locations. A few things to try:
conda install branca
pip install branca