Download fails when there is a space in the directory name

I’m creating this thread on behalf of @epicvu. The problem was originally mentioned in this thread. I am copying it below.

Special directory name issue in WSL

I know that it is not a common and good practice to have blankspaces in directories but I didn’t setup my profile at the time.

When it manages to work, since I have a space (between my first name and last name) in my user profile I am prompted of course with :

(venv) charles@DESKTOP-CVU:/mnt/c/Users/Charles VU/SDV_tests/$ sdv-installer download --folder ./sdv_folder/ --python-version 311 --platform musllinux_1_1_x86_64 --debug
Username: c.vu@epiconcept.fr
License Key: ********************************

Downloading SDV:

pip download sdv-enterprise==0.36.0 --index-url https://c.vu%40epiconcept.fr:****@pypi.datacebo.com/ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.datacebo.com --dest ./sdv_folder/ --only-binary=:all: --platform musllinux_1_1_x86_64 --python-version 311
Traceback (most recent call last):
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/bin/sdv-installer", line 10, in <module>
    sys.exit(run_cli())
             ^^^^^^^^^
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/cli/__main__.py", line 166, in run_cli
    args.action(args)
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/cli/__main__.py", line 46, in download_action
    download_packages(
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/authentication/authentication.py", line 81, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/installation/installer.py", line 465, in download_packages
    _download_packages_action(
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/installation/installer.py", line 264, in _download_packages_action
    _print_and_perform_action(
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/installation/installer.py", line 181, in _print_and_perform_action
    base_package_statuses = _perform_pip_action(
                            ^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/installation/installer.py", line 115, in _perform_pip_action
    process = subprocess.run(command.split())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/c/Users/Charles'

Even if try specifying the whole path in the --folder value

(venv) charles@DESKTOP-CVU:/mnt/c/Users/Charles VU/SDV_tests/$ sdv-installer download --folder /mnt/c/Users/Charles\ VU/SDV_tests/sdv_folder/ --python-version 311 --platform musllinux_1_1_x86_64 --debug
Username: c.vu@epiconcept.fr
License Key: ********************************

Downloading SDV:

pip download sdv-enterprise==0.36.0 --index-url https://c.vu%40epiconcept.fr:****@pypi.datacebo.com/ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.datacebo.com --dest ./sdv_folder/ --only-binary=:all: --platform musllinux_1_1_x86_64 --python-version 311
Traceback (most recent call last):
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/bin/sdv-installer", line 10, in <module>
    sys.exit(run_cli())
             ^^^^^^^^^
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/cli/__main__.py", line 166, in run_cli
    args.action(args)
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/cli/__main__.py", line 46, in download_action
    download_packages(
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/authentication/authentication.py", line 81, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/installation/installer.py", line 465, in download_packages
    _download_packages_action(
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/installation/installer.py", line 264, in _download_packages_action
    _print_and_perform_action(
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/installation/installer.py", line 181, in _print_and_perform_action
    base_package_statuses = _perform_pip_action(
                            ^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/Users/Charles VU/SDV_tests/venv/lib/python3.11/site-packages/sdv_installer/installation/installer.py", line 115, in _perform_pip_action
    process = subprocess.run(command.split())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/c/Users/Charles'

Hi @epicvu, thanks for these details. I don’t have a Windows, but I was able to partially replicate this on MacOS. Here’s what I see:

If I provide the full filepath, I am observing a similar issue. The SDV Installer is unable to reconcile the path and errors out. However, the error I see is a bit different.

% sdv-installer download --folder /Users/npatki/Documents/my\ folder/target --debug
pip download sdv-enterprise==0.36.0 ...
ERROR: Invalid requirement: 'folder/target': Expected end or semicolon (after name and no valid version specifier)
    folder/target
          ^

Interestingly, when I provide only the relative path, it’s working fine on my MacOS. That might be a difference between platforms.

% sdv-installer download --folder ./target --debug

I have filed this issue internally and will escalate it to our engineering team. Thanks!

1 Like