简体   繁体   English

在Python上读取Excel文件 - 无法追踪文件

[英]Reading Excel files on Python - file untraceable

Here is my problem: 这是我的问题:

I have an assignement for uni where we're asked to make an analysis of some problem (not important). 我有一个对uni的任命,我们被要求分析一些问题(不重要)。 We're given datas on excel files, and we are supposed to use python to code and solve our problem. 我们在excel文件上给出了数据,我们应该使用python来编码和解决我们的问题。 I've been through the internet to find out I had to install pip and to install the xlrd and openpyxl libraries (I wasn't sure which one). 我已经通过互联网找出我必须安装pip并安装xlrd和openpyxl库(我不知道哪一个)。 I am hoping to be able to eventually use these files through Python and to manipulate the datas just thanks to some simple line commands, and I guess now I've fixed everything except one thing. 我希望能够最终通过Python使用这些文件并通过一些简单的行命令操纵数据,我想我现在已经修复了除了一件事之外的所有东西。

On Python Shell, I'm writting the following instructions: 在Python Shell上,我正在编写以下指令:

import xlrd

import openpyxl

file_location = C:/Audrey/Desktop/CW/time.xlsx"

workbook = xlrd.open_workbook(file_location)

And then I got the line 然后我就明白了

"No such file or directory". “没有相应的文件和目录”。

Though, I am sure, that I did not any mistake. 虽然,我确信,我没有任何错误。 I have absolutely no clue what to do. 我完全不知道该怎么做。 Did I forget a step ? 我忘记了一步吗? Can someone help ? 有人可以帮忙吗?

忘了引号我相信:

file_location = "C:/Audrey/Desktop/CW/time.xlsx"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM