求教python 操作Excel文件时出错
编译器里面显示是没问题的后来我去pycharm里面看numpy pandas xlrd 这几个包是没有的,所以我又用pycharm导入了这几个包,但还是会报错
把 PyCharm 报错最后内容拷贝上来,最后几行才是提示什么原因报错 D:\pycharm\venv\Scripts\python.exe D:/pycharm/main.py
Traceback (most recent call last):
File "D:/pycharm/main.py", line 4, in <module>
数据.to_excel(路径)
File "D:\pycharm\venv\lib\site-packages\pandas\core\generic.py", line 2284, in to_excel
formatter.write(
File "D:\pycharm\venv\lib\site-packages\pandas\io\formats\excel.py", line 834, in write
writer = ExcelWriter(# type: ignore
File "D:\pycharm\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 52, in __init__
super().__init__(
File "D:\pycharm\venv\lib\site-packages\pandas\io\excel\_base.py", line 925, in __init__
self.handles = get_handle(
File "D:\pycharm\venv\lib\site-packages\pandas\io\common.py", line 711, in get_handle
handle = open(handle, ioargs.mode)
PermissionError: Permission denied: 'c:/新建空白文件.xlsx' Twilight6 发表于 2021-9-16 12:55
把 PyCharm 报错最后内容拷贝上来,最后几行才是提示什么原因报错
D:\pycharm\venv\Scripts\python.exe D:/pycharm/main.py
Traceback (most recent call last):
File "D:/pycharm/main.py", line 4, in <module>
数据.to_excel(路径)
File "D:\pycharm\venv\lib\site-packages\pandas\core\generic.py", line 2284, in to_excel
formatter.write(
File "D:\pycharm\venv\lib\site-packages\pandas\io\formats\excel.py", line 834, in write
writer = ExcelWriter(# type: ignore
File "D:\pycharm\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 52, in __init__
super().__init__(
File "D:\pycharm\venv\lib\site-packages\pandas\io\excel\_base.py", line 925, in __init__
self.handles = get_handle(
File "D:\pycharm\venv\lib\site-packages\pandas\io\common.py", line 711, in get_handle
handle = open(handle, ioargs.mode)
PermissionError: Permission denied: 'c:/新建空白文件.xlsx' Twilight6 发表于 2021-9-16 12:55
把 PyCharm 报错最后内容拷贝上来,最后几行才是提示什么原因报错
刚刚提示的是这个:Missing optional dependency 'fsspec'. Use pip or conda to install fsspec.
我把这个包安装进去后 就显示发出来的这个错误了 Twilight6 发表于 2021-9-16 12:55
把 PyCharm 报错最后内容拷贝上来,最后几行才是提示什么原因报错
已经解决了 好像是C盘目录权限问题 我在桌面是可以创建的 monkey1024 发表于 2021-9-16 13:13
已经解决了 好像是C盘目录权限问题 我在桌面是可以创建的
你用管理员身份打开 PyCharm 就可以在 C盘创建文件
页:
[1]