我对使用tkinter编写代码还比较陌生,因此我对此问题表示歉意。我正在tkinter中编写一个应用程序,我想根据小部件中的条目在Excel中更新值。
我尝试通过pip安装和手动安装来安装openpyxl。我已经将openpyxl移到了项目的文件夹中,但是并没有任何帮助。
from tkinter import *
from tkinter import ttk
import tkinter as tk
from datetime import datetime
from tkinter import messagebox
import os
import pandas as pd
import xlrd
import xlwt
from pandas import ExcelWriter
from pandas import ExcelFile
import sqlite3
import getpass
import openpyxl
我遇到错误
Traceback (most recent call last):
File "C:/Users/vik.makker/Desktop/NewProj/Internal Inventory Tracking System.py", line 1, in <module>
import openpyxl
File "C:\Users\vik.makker\Desktop\NewProj\openpyxl\__init__.py", line 5, in <module>
from openpyxl.workbook import Workbook
File "C:\Users\vik.makker\Desktop\NewProj\openpyxl\workbook\__init__.py", line 5, in <module>
from .workbook import Workbook
File "C:\Users\vik.makker\Desktop\NewProj\openpyxl\workbook\workbook.py", line 8, in <module>
from openpyxl.worksheet.worksheet import Worksheet
File "C:\Users\vik.makker\Desktop\NewProj\openpyxl\worksheet\worksheet.py", line 30, in <module>
from openpyxl.cell import Cell, MergedCell
File "C:\Users\vik.makker\Desktop\NewProj\openpyxl\cell\__init__.py", line 4, in <module>
from .cell import Cell, WriteOnlyCell, MergedCell
File "C:\Users\vik.makker\Desktop\NewProj\openpyxl\cell\cell.py", line 32, in <module>
from openpyxl.utils.datetime import (
File "C:\Users\vik.makker\Desktop\NewProj\openpyxl\utils\datetime.py", line 13, in <module>
from jdcal import (
ModuleNotFoundError: No module named 'jdcal'
答案 0 :(得分:0)
错误是,尽管您已经安装了openpyxl,但尚未安装所有依赖项(这可能只是编写openpyxl的人员如何指定其工具所需的软件包的错误)。错误消息的最后一行说,您还需要安装jdcal
,我怀疑之后您的代码可以正常工作。