这是我的代码
from openpxyl import Workbook
wb=Workbook()
wb.save(r"C:\Users\myname\Desktop\pythonprojects\players.xlsx")
为了显示我已经安装了它,这就是我尝试安装它时的内容
Requirement already satisfied: openpyxl in c:\users\myname\appdata\local\programs\python\python37 (3.0.3)
Requirement already satisfied: jdcal in c:\users\myname\appdata\local\programs\python\python37 (from openpyxl) (1.4.1)
Requirement already satisfied: et_xmlfile in c:\users\myname\appdata\local\programs\python\python37 (from openpyxl) (1.0.1)
我也尝试了pip3安装,但它说的也是一样。
我对编码非常陌生,感谢您的任何答复。
我认为,当您的系统上安装了多个python时,就会发生此问题。尝试删除其中一个python。并使用以下命令重新安装openpyxl:
pip install openpyxl