커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
1-5 업무자동화 - 엑셀다루기 수업에서 파일 업로드 후 불러올 때 오류 발생합니다.
undefined주차
북마크
김*영
댓글
6
추천
0
조회수
10
조회수
10
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


수업 진행에 맞춰 파일 생성, 파일 다운로드, 파일 수정 후 업로드, 이후 불러오기 순서로 진행했는데요

아래와 같이 오류가 발생하며 엑셀 데이터를 불러오지 못하고 있습니다.

답변 부탁드립니다.


스파르타 즉문즉답





작성코드

import openpyxl
wb = openpyxl.load_workbook('샘플파일.xlsx')
sheet = wb['Sheet']


sheet['A1'].value


에러 메세지

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-14-f5d21de52ff8> in <cell line: 2>()
      1 import openpyxl
----> 2 wb = openpyxl.load_workbook('샘플파일.xlsx')
      3 sheet = wb['Sheet']
      4 
      5 sheet['A1'].value


3 frames
/usr/local/lib/python3.10/dist-packages/openpyxl/reader/excel.py in load_workbook(filename, read_only, keep_vba, data_only, keep_links, rich_text)
    342 
    343     """
--> 344     reader = ExcelReader(filename, read_only, keep_vba,
    345                          data_only, keep_links, rich_text)
    346     reader.read()

/usr/local/lib/python3.10/dist-packages/openpyxl/reader/excel.py in __init__(self, fn, read_only, keep_vba, data_only, keep_links, rich_text)
    121     def __init__(self, fn, read_only=False, keep_vba=KEEP_VBA,
    122                  data_only=False, keep_links=True, rich_text=False):
--> 123         self.archive = _validate_archive(fn)
    124         self.valid_files = self.archive.namelist()
    125         self.read_only = read_only

/usr/local/lib/python3.10/dist-packages/openpyxl/reader/excel.py in _validate_archive(filename)
     93             raise InvalidFileException(msg)
     94 
---> 95     archive = ZipFile(filename, 'r')
     96     return archive
     97 

/usr/lib/python3.10/zipfile.py in __init__(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)
   1249             while True:
   1250                 try:
-> 1251                     self.fp = io.open(file, filemode)
   1252                 except OSError:
   1253                     if filemode in modeDict:

FileNotFoundError: [Errno 2] No such file or directory: '샘플파일.xlsx'
취소
 공유
취소
댓글 0
댓글 알림
나의얼굴