microsoft/qlib · error · FileNotFoundError
Invalid mount path: {mount_path}! Please mount manually: {'
Error message
Invalid mount path: {mount_path}! Please mount manually: {' '.join(mount_command)} or Set init parameter `auto_mount=True` What it means
Raised by the module-level file-reading helper in scripts/dump_bin.py (used by DumpDataBase._get_source_data and friends). It dispatches on the file suffix and only knows how to read .csv (via pd.read_csv) and .parquet (via pd.read_parquet); any other suffix reaches the else branch and is rejected. It exists so that dump_bin can ingest either CSV or Parquet source files with per-format kwargs (e.g. low_memory only for CSV).
Source
Thrown at qlib/__init__.py:100
logger.info("qlib successfully initialized based on %s settings." % default_conf)
data_path = {_freq: C.dpm.get_data_uri(_freq) for _freq in C.dpm.provider_uri.keys()}
logger.info(f"data_path={data_path}")
def _mount_nfs_uri(provider_uri, mount_path, auto_mount: bool = False):
LOG = get_module_logger("mount nfs", level=logging.INFO)
if mount_path is None:
raise ValueError(f"Invalid mount path: {mount_path}!")
if not re.match(r"^[a-zA-Z0-9.:/\-_]+$", provider_uri):
raise ValueError(f"Invalid provider_uri format: {provider_uri}")
# FIXME: the C["provider_uri"] is modified in this function
# If it is not modified, we can pass only provider_uri or mount_path instead of C
mount_command = ["sudo", "mount.nfs", provider_uri, mount_path]
# If the provider uri looks like this 172.23.233.89//data/csdesign'
# It will be a nfs path. The client provider will be used
if not auto_mount: # pylint: disable=R1702
if not Path(mount_path).exists():
raise FileNotFoundError(
f"Invalid mount path: {mount_path}! Please mount manually: {' '.join(mount_command)} or Set init parameter `auto_mount=True`"
)
else:
# Judging system type
sys_type = platform.system()
if "windows" in sys_type.lower():
# system: window
try:
subprocess.run(
["mount", "-o", "anon", provider_uri, mount_path],
capture_output=True,
text=True,
check=True,
)
LOG.info("Mount finished.")
except subprocess.CalledProcessError as e:
error_output = (e.stdout or "") + (e.stderr or "")
if e.returncode == 85:View on GitHub (pinned to 79633dd950)
Solutions
- Inspect the offending file: find <data_dir> -type f ! -name '*.csv' ! -name '*.parquet' — remove temp/partial files or move them out of the data dir.
- Convert the unsupported file to CSV or Parquet before dumping (df = pd.read_excel(...); df.to_csv(...)).
- If you control the pipeline, standardize the export step to always emit .csv or .parquet and write atomically (write to temp name, then rename) so partial files never carry a final suffix.
Example fix
# before: data_dir contains prices.xlsx alongside prices.csv
python dump_bin.py dump_all --data_path ./data_dir ... # ValueError: Unsupported file format: .xlsx
# after: convert first, keep only .csv/.parquet in data_dir
import pandas as pd
pd.read_excel('data_dir/prices.xlsx').to_csv('data_dir/prices.csv', index=False) Defensive patterns
Strategy: type-guard
Validate before calling
from pathlib import Path
bad = [str(p) for p in Path(data_dir).iterdir() if p.is_file() and p.suffix.lower() not in (".csv", ".parquet")]
if bad:
raise SystemExit(f"Unsupported source files in {data_dir}: {bad}") Type guard
from pathlib import Path
def is_supported_source(p: Path) -> bool:
return p.is_file() and p.suffix.lower() in (".csv", ".parquet") Try / catch
try:
dumper._get_source_data(file_path)
except ValueError as e:
if "Unsupported file format" in str(e):
logger.warning("skipping %s: %s", file_path, e)
continue
raise Prevention
- Write downloads atomically: temp name without a final suffix, then rename to .csv/.parquet only when complete.
- Keep the dump source directory dedicated to a single export format; scrub temp/hidden files before dumping.
When it happens
Trigger: Calling dump_bin.py with a --data dir containing files whose extension is neither .csv nor .parquet (e.g. .txt, .json, .xlsx, .feather, .h5, or extensionless temp/partial download files such as '.csv.part'); a partially downloaded or hidden file like .DS_Store or a lock file in the source directory; case-sensitivity issues such as .CSV on case-sensitive filesystems.
Common situations: Mixed-format source directories where most files are CSV but one export is xlsx; leftover partial downloads or editor temp files (~$file.csv, file.csv.tmp) inside the data dir; renaming data files without updating the extension; users assuming dump_bin reads any pandas-compatible format.
Related errors
- Network path not found
- $close is necessray in extra_quote
- stock data from resam_ts_data must be a number, pd.Series or
- Please implement the `droplevel` method
- This type of input is not supported
AI-assisted analysis of microsoft/qlib@79633dd950 (2026-08-15).
Data as JSON: /api/errors/84f20c29eda7ecac.
Report an issue: GitHub.