Cannot use giotto in google colab - python

I installed giotto-tda library with a command: %pip install --user pyproj giotto-tda
and then tried to use: from gtda.time_series import TakensEmbedding
but I am still getting an error: "No module named 'gtda'.
Did you have a similar problem?

Related

How to properly import the ConfigServiceV2Client attribute from google-cloud-logging_v2 package in Python?

I tried importing the ConfigServiceV2Client attribute as follows:
from google.cloud.logging_v2.services.config_service_v2 import ConfigServiceV2Client
And I got the following error:
AttributeError: module 'google.cloud.logging_v2' has no attribute 'ConfigServiceV2Client'
How should I import it?
Based on the error that you're getting it seems like you are missing some updated features, Install the google-cloud-logging package using pip as follows:
pip install --upgrade google-cloud-logging
based on the google documentation.
After installing it try importing it in to your project.
Or just uninstall the package:
pip uninstall google-cloud-logging
And then reinstall it.

ImportError: cannot import name 'DecisionBoundaryDisplay' from 'sklearn.inspection'

I imported sklearn DecisionBoundaryDisplay via the below command in my Google Colab file.
from sklearn.inspection import DecisionBoundaryDisplay
And I'm getting the following error.
ImportError: cannot import name 'DecisionBoundaryDisplay' from 'sklearn.inspection'
I even installed the following packages & also tried by restarting my runtime but still I'm getting the error.
!pip install --upgrade scikit-learn
!pip install scipy
!pip3 install -U scikit-learn scipy matplotlib
How to fix this issue?
what worked for me was installing scikit learn 1.1.0, i had version 1.0.2 before and got the same error you're encountering.
pip install -U scikit-learn --user
Hope it helps.
It seems DecisionBoundaryDisplay is a new feature and it is currently in an unstable development version. To use it, you need to install the nightly build.

cannot import name '_registerMatType' from 'cv2.cv2' (/usr/local/lib/python3.7/dist-packages/cv2/cv2.cpython-37m-x86_64-linux-gnu.so)

I got below error message when I run some codes according to Google Colab:'cannot import name '_registerMatType' from 'cv2.cv2' (/usr/local/lib/python3.7/dist-packages/cv2/cv2.cpython-37m-x86_64-linux-gnu.so)'. And I tried to uninstall the opencv-python-headless==4.5.5.62 and installing opencv 4.1.2.30 using the following lines:'!pip uninstall opencv-python-headless==4.5.5.62 !pip install opencv-python==4.1.2.30 'but it seemed that the new version wasn't installed because it then said'no module named cv2'. How should I do to fix this problem?
!pip uninstall opencv-python-headless==4.5.5.62
!pip install opencv-python-headless==4.1.2.30
worked for me

ModuleNotFoundError: No module named 'flair'

I have installed flair library via the following command
!pip install flair
but when i tries to import it, it will generate error like "ModuleNotFoundError: No module named 'flair'"
Code:
import torch
import numpy as np
from flair.data import Sentence
from flair.embeddings import TransformerDocumentEmbeddings
install via the following command make sure you use --user option otherwise you will get a permission error in windows 10.
!pip install --user flair
after install flair you have to restart kernel in jupyter notebook

Multiple errors importing and using mglearn

I'm getting multiple errors trying to install and import the mglearn library into a Jupyter notebook. I've installed mglearn using the command line using pip install mglearn and also directly into Jupyter using !pip install mglearn. However, when I try to import mglearn I get the error ModuleNotFoundError: No module named 'mglearn'. If I try to install it again I get a Requirement already satisfied response.
I then went into the python terminal with $python3 and tried import mglearn, which was successful. I checked the version and I get 0.1.7.
I've also tried the following code within Jupyter:
import sys
!{sys.executable} -m pip install mglearn
With that code I get a zsh:1: no matches found: error.
I know it's installed and I'm importing it. I'm out of ideas for how to fix this. Any help would be appreciated.

Categories

Resources