Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gshtras opened this issue Apr 28, 2025 · 2 comments
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@gshtras
Copy link

gshtras commented Apr 28, 2025

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
@gshtras gshtras added bug Needs Triage Issues that need to be evaluated for severity and status. labels Apr 28, 2025
@gshtras gshtras changed the title [BUG] [BUG] Running with --prefix leads to a crash Apr 28, 2025
@gshtras gshtras changed the title [BUG] Running with --prefix leads to a crash [BUG] Running with --prefix leads to expected str, bytes or os.PathLike object, not NoneType Apr 28, 2025
@jaraco
Copy link
Member

jaraco commented Apr 29, 2025

Oops. Yeah, I see the error. The logic there should be to use self.index_url in both parts of the computation.

@jaraco jaraco closed this as completed in 92ff129 Apr 29, 2025
@jaraco
Copy link
Member

jaraco commented Apr 29, 2025

Thanks for the report. Fix going out as v80.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

2 participants