holzschu / Carnets

Carnets is a stand-alone Jupyter notebook server and client. Edit your notebooks on the go, even where there is no network.
https://holzschu.github.io/Carnets_Jupyter/
BSD 3-Clause "New" or "Revised" License
567 stars 34 forks source link

Pandas read_excel: „[Error 2] No such file or directory“ #250

Open et15 opened 2 years ago

et15 commented 2 years ago

Hi, When importing a Excel file a error gets thrown:


FileNotFoundError Traceback (most recent call last) Input In [3], in <cell line: 1>() ----> 1 v2p_data = pd.read_excel("PGP2V09.xlsx", 2 "V09.2p") 3 v2p_U0 = 10.51 4 v2p_dU0 = 0.01

File /private/var/containers/Bundle/Application/2C24EEFD-9A05-4021-98CB-B443DBD23511/Carnets-sci.app/Library/lib/python3.9/site-packages/pandas-1.4.2-py3.9-macosx-12.3-x86_64.egg/pandas/util/_decorators.py:311, in deprecate_nonkeyword_arguments..decorate..wrapper(*args, *kwargs) 305 if len(args) > num_allow_args: 306 warnings.warn( 307 msg.format(arguments=arguments), 308 FutureWarning, 309 stacklevel=stacklevel, 310 ) --> 311 return func(args, **kwargs)

File /private/var/containers/Bundle/Application/2C24EEFD-9A05-4021-98CB-B443DBD23511/Carnets-sci.app/Library/lib/python3.9/site-packages/pandas-1.4.2-py3.9-macosx-12.3-x86_64.egg/pandas/io/excel/_base.py:457, in read_excel(io, sheet_name, header, names, index_col, usecols, squeeze, dtype, engine, converters, true_values, false_values, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, parse_dates, date_parser, thousands, decimal, comment, skipfooter, convert_float, mangle_dupe_cols, storage_options) 455 if not isinstance(io, ExcelFile): 456 should_close = True --> 457 io = ExcelFile(io, storage_options=storage_options, engine=engine) 458 elif engine and engine != io.engine: 459 raise ValueError( 460 "Engine should not be specified when passing " 461 "an ExcelFile - ExcelFile already has the engine set" 462 )

File /private/var/containers/Bundle/Application/2C24EEFD-9A05-4021-98CB-B443DBD23511/Carnets-sci.app/Library/lib/python3.9/site-packages/pandas-1.4.2-py3.9-macosx-12.3-x86_64.egg/pandas/io/excel/_base.py:1376, in ExcelFile.init(self, path_or_buffer, engine, storage_options) 1374 ext = "xls" 1375 else: -> 1376 ext = inspect_excel_format( 1377 content_or_path=path_or_buffer, storage_options=storage_options 1378 ) 1379 if ext is None: 1380 raise ValueError( 1381 "Excel file format cannot be determined, you must specify " 1382 "an engine manually." 1383 )

File /private/var/containers/Bundle/Application/2C24EEFD-9A05-4021-98CB-B443DBD23511/Carnets-sci.app/Library/lib/python3.9/site-packages/pandas-1.4.2-py3.9-macosx-12.3-x86_64.egg/pandas/io/excel/_base.py:1250, in inspect_excel_format(content_or_path, storage_options) 1247 if isinstance(content_or_path, bytes): 1248 content_or_path = BytesIO(content_or_path) -> 1250 with get_handle( 1251 content_or_path, "rb", storage_options=storage_options, is_text=False 1252 ) as handle: 1253 stream = handle.handle 1254 stream.seek(0)

File /private/var/containers/Bundle/Application/2C24EEFD-9A05-4021-98CB-B443DBD23511/Carnets-sci.app/Library/lib/python3.9/site-packages/pandas-1.4.2-py3.9-macosx-12.3-x86_64.egg/pandas/io/common.py:798, in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options) 789 handle = open( 790 handle, 791 ioargs.mode, (...) 794 newline="", 795 ) 796 else: 797 # Binary mode --> 798 handle = open(handle, ioargs.mode) 799 handles.append(handle) 801 # Convert BytesIO or file objects passed with an encoding

FileNotFoundError: [Errno 2] No such file or directory: 'PGP2V09.xlsx'

The file is in the same directory. Directory permissions are granted.

Can somebody tell why it is not working?

Thanks already Erik