How can I fix import error using google colab? - python

I'm following this guide, but I have a lot of issues already in the INITIALIZATION.
I use Google Colab and I have done the pip install with pip install git+https://github.com/microsoft/ComputerVision.git#master#egg=utils_cv
When running the first error is ImportError: cannot import name 'Video'
with the line from IPython.display import Video
I have no idea to fix it, some one can help?

Related

I was not able to import libraries in google colab

what that mean when i get the below error in google colab ?
File "", line 1
coding pyton in google colab and i was imorting the libraries
and it give me this error
Most likely you need to install the libraries before importing them. You can do this by using a different code cell. An example below for selenium:
!pip install selenium
Use this line and replace selenium with the library you need and run the code-cell.
After this the code should run without errors.
Fist of all, you need to show the Error you got.
But maybe you haven't installed the Packages, that's why you got error while Importing.
So you need to install the Packages using " pip install "

load_dataset('multi_nli') from dataset is not working, getting import error

I am currently working on an NLI project, and about a week ago, load_dataset('multi_nli') was working just fine. However, when I was about to import it again and test a different model, an import error is showing up.
ImportError: cannot import name 'setup_logging' from 'fsspec.utils' (/opt/conda/lib/python3.7/site-packages/fsspec/utils.py)
Everything should be installed, like datasets and such but it is not working.
Ran into the same issue in a kaggle notebook.
For me the solution was uninstalling s3fs which was the package that caused the import of fsspec in the first place. So just add this in a cell at the beginning of your kaggle notebook.
!pip3 install datasets
!pip3 uninstall fsspec

How to solve GraphQl ImportError - cannot import name 'gql' from 'gql' in Python?

I installed GraphQl on Windows 10 Laptop using the below command:
pip install --pre gql[all]
I tried using the Basic example available on Official Github Page. in my Python IDLE.
However, I am getting this ImportError in my IDLE.
ImportError: cannot import name 'gql' from 'gql'
Kindly help in resolving the issue.
Thanks
make sure the name of your file you're testing with isn't named something similar to a package you're importing. Just got me when I named my file ariadne.py
https://github.com/mirumee/ariadne/issues/400#issue-662473441

Cannot import Azure Storage Blob package even though it is installed

I want to write a script to upload files to Azure Blob Storage. I installed the Azure Storage Blob package following this documentation and then tried to run from azure.storage.blob import BlobServiceClient I got the error:
No module named 'azure.storage'; 'azure' is not a package.
When I run pip show azure-storage-blob the package is in the expected place that is included in PATH.
The strange thing is that I can run import azure just fine but when I run pip show azure I get
WARNING: Package(s) not found: azure
This doesnt work either: from azure import BlobServiceClient.
I am using Anaconda / Windows and I tried this with Python 3.6, 3.7 and 3.8 with the same results.
Any help would be greatly appreciated. Thank you.
This issue was solved by Eric Truett's comment, add it as the answer to close the question:
Try launching the anaconda prompt,
then type ipython,
then, in ipython, try from azure.storage.blob import BlobServiceClient.
If you get an ImportError, then try !pip install azure-storage-blob and then try the import again.
I tried from azure.storage.blob import BlobServiceClient and got no
error. So I went to Spyder and just ran the import there. It worked. I
did not change anything else but it is working now.

Can not import google.cloud module in python script

I am following this article trying to make my Python script read labels related to an image using Google Cloud Vision API. The problem is that I am getting this error when trying to include a reference to vision from google.cloud module.
import io
from google.cloud import vision
from google.cloud.vision import types
The error that I am getting says:
ImportError: No module named 'google.cloud'
This is weird because when I do:
$ pip show google-cloud
I can see it is there and its files are located at:
/usr/local/lib/python2.7/dist-packages/google_cloud-0.34.0.dist-info/*
Except for that, when I do pip freeze in my working folder I can see them both that I need available:
google-cloud==0.34.0
google-cloud-vision==0.33.0
I am now wondering what could be the reason for not being able to see include this module in my Python script.
The google-cloud package is deprecated, you should uninstall it and install google-cloud-vision instead.
This link might provide some assistance:
https://cloud.google.com/python/
Edited
upon looking into it further, I was able to do the following:
pip install google-cloud-vision
and import everything with:
import io
import os
from google.cloud import vision
from google.cloud.vision import types
Maybe try uninstalling the package through pip and reinstalling it with the above?

Categories