Home > database >  Error from _plotly_utils.importers import relative_import Vscode, what is wrong?
Error from _plotly_utils.importers import relative_import Vscode, what is wrong?

Time:01-11

I have the following libraries installed in Vscode, I checked them using pip show "library" and see requirement fulfilled for all of them, but I still get the error:

import plotly
import plotly.graph_objects as go
import pandas
from datetime import datetime
import requests
import csv
import json
from io import StringIO
import slack
import os
from pathlib import Path
from dotenv import load_dotenv

I get the error in the first line saying:

from _plotly_utils.importers import relative_import

When I delete the first and second line I get the following error:

line 3, in import pandas ImportError: cannot import name gettz

Solutions I have tried: I have tried installing a package called cufflinks, when I try to do that I get the following error message

WARNING: Discarding https://files.pythonhosted.org/packages/93/95/1d392bc472e8d9a2a040e169122c5bdb18fb56b9d8c04431886bdb55d4d7/cufflinks-0.2.tar.gz#sha256=4070b729e0d2c9e7c6dbcd76cfe426a2a4c89b1122f7e48a41f1d84b95b8b14b (from https://pypi.org/simple/cufflinks/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Could not find a version that satisfies the requirement cufflinks (from versions: 0.2, 0.3, 0.3.2, 0.4, 0.5, 0.6, 0.6.1, 0.6.3, 0.6.4, 0.6.7, 0.7.0, 0.7.1, 0.7.2, 0.8.2, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.14.1, 0.14.3, 0.14.4, 0.14.5, 0.14.6, 0.15, 0.16, 0.17.0, 0.17.3) ERROR: No matching distribution found for cufflinks

The code was working fine until few hours ago I deleted few files while playing around with the git function, I had not created a git at all and think deleting/removing files may have deleted some important file needed to run this script.

CodePudding user response:

You can simply reinstall the needed packages. The pip will install the dependency packages for you.

pip install --upgrade plotly
pip install --upgrade pandas
  •  Tags:  
  • Related