admin管理员组

文章数量:1122832

_tkinter.TclError: Can't find a usable init.tcl in the following directories: C:/Users/91953/AppData/Local/Programs/Python/Python313/lib/tcl8.6 C:/Users/91953/AppData/Local/Programs/Python/lib/tcl8.6 C:/Users/91953/AppData/Local/Programs/lib/tcl8.6 C:/Users/91953/AppData/Local/Programs/Python/library C:/Users/91953/AppData/Local/Programs/library C:/Users/91953/AppData/Local/Programs/tcl8.6.14/library C:/Users/91953/AppData/Local/tcl8.6.14/library

This probably means that Tcl wasn't installed properly.

Trying to plot a graph using this code:

import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from collections import Counter
plt.style.use("fivethirtyeight") 
y_trial =[10,20,30]
plt.bar(x_trial, y_trial, color= "#444444",label  ="Trial")
plt.legend()
plt.title(" Total sales per region")
plt.xlabel("Region")
plt.ylabel("Sales")
plt.show()

Am I missing anything in the code or something else? PS: I tried using 3.9 and 3.13 version also tried re installing pylance also tried reinstalling all libraries.

本文标签: pythontrying to plot a graph using matplotlib but showing this errorStack Overflow