Skip to content

Fails to install/load correctly on tuolumne with flux run #1115

@matthiasdiener

Description

@matthiasdiener

Fresh emirge installations (or reinstalling packages on prior installations) fail to correctly make packages loadable that are installed both editable and with setuptools when run with flux run:

$ flux run python -O -c "import logpyle; print(dir(logpyle))"
Error processing line 2 of /p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable__.dagrt-2021.1.pth:

  Traceback (most recent call last):
    File "<frozen site>", line 206, in addpackage
    File "<string>", line 1, in <module>
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable___dagrt_2021_1_finder.py", line 7, in <module>
      from pathlib import Path
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/pathlib.py", line 20, in <module>
      from urllib.parse import quote_from_bytes as urlquote_from_bytes
  SyntaxError: source code string cannot contain null bytes

Remainder of file ignored
Error processing line 1 of /p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable__.leap-2021.1.pth:

  Traceback (most recent call last):
    File "<frozen site>", line 206, in addpackage
    File "<string>", line 1, in <module>
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable___leap_2021_1_finder.py", line 7, in <module>
      from pathlib import Path
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/pathlib.py", line 20, in <module>
      from urllib.parse import quote_from_bytes as urlquote_from_bytes
  SyntaxError: source code string cannot contain null bytes

Remainder of file ignored
Error processing line 1 of /p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable__.logpyle-2025.0.pth:

  Traceback (most recent call last):
    File "<frozen site>", line 206, in addpackage
    File "<string>", line 1, in <module>
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable___logpyle_2025_0_finder.py", line 7, in <module>
      from pathlib import Path
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/pathlib.py", line 20, in <module>
      from urllib.parse import quote_from_bytes as urlquote_from_bytes
  SyntaxError: source code string cannot contain null bytes

Remainder of file ignored
Error processing line 1 of /p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable__.mirgecom-2020.1.pth:

  Traceback (most recent call last):
    File "<frozen site>", line 206, in addpackage
    File "<string>", line 1, in <module>
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable___mirgecom_2020_1_finder.py", line 7, in <module>
      from pathlib import Path
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/pathlib.py", line 20, in <module>
      from urllib.parse import quote_from_bytes as urlquote_from_bytes
  SyntaxError: source code string cannot contain null bytes

Remainder of file ignored
Error processing line 1 of /p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable__.pyrometheus-2020.1.pth:

  Traceback (most recent call last):
    File "<frozen site>", line 206, in addpackage
    File "<string>", line 1, in <module>
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/site-packages/__editable___pyrometheus_2020_1_finder.py", line 7, in <module>
      from pathlib import Path
    File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/pathlib.py", line 20, in <module>
      from urllib.parse import quote_from_bytes as urlquote_from_bytes
  SyntaxError: source code string cannot contain null bytes

Remainder of file ignored
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/p/lustre5/diener3/Work_tuo/einsta/logpyle/logpyle/__init__.py", line 66, in <module>
    import importlib.metadata
  File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/importlib/metadata/__init__.py", line 7, in <module>
    import pathlib
  File "/p/lustre5/diener3/Work_tuo/einsta/miniforge3/envs/ceesd/lib/python3.12/pathlib.py", line 20, in <module>
    from urllib.parse import quote_from_bytes as urlquote_from_bytes
SyntaxError: source code string cannot contain null bytes
flux-job: task(s) exited with exit code 1

Packages involved seem to be dagrt, leap, logpyle, mirgecom, pyrometheus.
As far as I can tell, the relevant *.pth files do not contain null bytes.
Installing older versions of setuptools (and reinstalling packages) does not seem to fix the issue. Installing non-editable, or editable with hatchling, seems to work.

Note that this only happens when using flux run, not when running python directly.

cc @anderson2981 @inducer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions