Skip to content

[BUG] Running with --prefix leads to expected str, bytes or os.PathLike object, not NoneType #4966

@gshtras

Description

@gshtras

setuptools version

80.0.0

Python version

3.12

OS

Ubuntu 22.04

Additional environment information

No response

Description

Using python setup.py develop with --prefix results in an error:
TypeError: expected str, bytes or os.PathLike object, not NoneType
Due to https://github.com/pypa/setuptools/blob/main/setuptools/command/develop.py#L37
+ ['--index-url', self.index_url] * bool(self.prefix) resolves to ['--index-url', None]

Expected behavior

python setup.py develop --prefix ~/.local should not crash

How to Reproduce

Run python setup.py develop --prefix ~/.local with setuptools==80 on a repo that is using setuptools, such as https://github.com/ROCm/vllm

Output

Traceback (most recent call last):
  File "/root/vllm/setup.py", line 678, in <module>
    setup(
  File "/usr/local/lib/python3.12/dist-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/setuptools/_distutils/core.py", line 186, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/setuptools/_distutils/core.py", line 202, in run_commands
    dist.run_commands()
  File "/usr/local/lib/python3.12/dist-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.12/dist-packages/setuptools/dist.py", line 1104, in run_command
    super().run_command(command)
  File "/usr/local/lib/python3.12/dist-packages/setuptools/_distutils/dist.py", line 1021, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.12/dist-packages/setuptools/command/develop.py", line 39, in run
    subprocess.check_call(cmd)
  File "/usr/lib/python3.12/subprocess.py", line 408, in check_call
    retcode = call(*popenargs, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 389, in call
    with Popen(*popenargs, **kwargs) as p:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.12/subprocess.py", line 1885, in _execute_child
    self.pid = _fork_exec(
               ^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions