简体   繁体   English

协作导入.py文件错误

[英]Colaboratory importing .py files error

I mounted Google drive in Colaboratory and set path to the drive/. 我将Google驱动器安装在Colaboratory中,并设置了驱动器的路径。 It seems that the path is set correctly, however when I run my code, the files can't be read. 似乎路径设置正确,但是当我运行代码时,无法读取文件。 I am quite sure that proc_data_lib.py is a pythonfile instead of zip file and the first few lines of that python file is in the second picture Error Images 我很确定proc_data_lib.py是一个pythonfile而不是zip文件,并且该python文件的前几行在第二张图片中。

File:proc_data_lib.py 文件:proc_data_lib.py

ERROR INFO: File "drive/ECMLDeepAudio-Master/lib/proc_data_lib.py", line 1 PK rpL^ 2' ' mimetypeapplication/vnd.oasis.opendocument.textPK rpL/ 4z Thumbnails/thumbnail.png PNG ^ SyntaxError: invalid syntax 错误信息:文件“ drive / ECMLDeepAudio-Master / lib / proc_data_lib.py”,第1行PK rpL^ 2'. ' mimetypeapplication/ vnd.oasis.opendocument.textPK rpL/ 4z Thumbnails/thumbnail.png PNG^ SyntaxError:无效的语法

The problem here is that the file is not just a text file -- from the error message, it seems to be a custom format of type oasis.opendocument.text , which looks to be an OpenOffice file . 这里的问题在于该文件不仅仅是一个文本文件-从错误消息来看,它似乎是oasis.opendocument.text类型的自定义格式,它看起来像是OpenOffice文件 Were you writing the file with something like OpenOffice? 您是否正在使用OpenOffice之类的文件编写文件?

Switching to a vanilla text file should fix things. 切换到普通文本文件应该可以解决问题。

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

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