Skip to content
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

Puffin fails with python-build-standalone #965

Closed
konstin opened this issue Jan 18, 2024 · 0 comments · Fixed by #966
Closed

Puffin fails with python-build-standalone #965

konstin opened this issue Jan 18, 2024 · 0 comments · Fixed by #966
Labels
bug Something isn't working

Comments

@konstin
Copy link
Member

konstin commented Jan 18, 2024

To reproduce:

rye init a
cd a
rye pin --relaxed [email protected]
rye sync # Create the venv
source .venv/bin/activate
rye add meine_stadt_transparent
puffin pip compile --no-cache pyproject.toml
error: Failed to download and build: django-settings-export==1.2.1
  Caused by: Failed to build: django-settings-export==1.2.1
  Caused by: Build backend failed to determine metadata through `prepare_metadata_for_build_wheel`:
--- stdout:

--- stderr:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/tmp/.tmplgCMCy/.venv/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  safe_path = 0
  import site = 1
  is in build tree = 0
  stdlib dir = '/install/lib/python3.12'
  sys._base_executable = '/home/konsti/.rye/py/[email protected]/install/bin/python3.12'
  sys.base_prefix = '/install'
  sys.base_exec_prefix = '/install'
  sys.platlibdir = 'lib'
  sys.executable = '/tmp/.tmplgCMCy/.venv/bin/python'
  sys.prefix = '/install'
  sys.exec_prefix = '/install'
  sys.path = [
    '/install/lib/python312.zip',
    '/install/lib/python3.12',
    '/install/lib/python3.12/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007fa7c1a8c740 (most recent call first):
  <no Python frame>
---

This error can happen when loading python through libpython and not setting PYTHONHOME, needs investigation why it happens with standalone python.

@konstin konstin added the bug Something isn't working label Jan 18, 2024
konstin added a commit that referenced this issue Jan 18, 2024
Fixes #965

We have to canonicalize the interpreter path, otherwise the home is set to the venv dir instead of the real root. This would make python-build-standalone fail with the encodings module not being found because its home is wrong.
konstin added a commit that referenced this issue Jan 18, 2024
Fixes #965

We have to canonicalize the interpreter path, otherwise the home is set
to the venv dir instead of the real root. This would make
python-build-standalone fail with the encodings module not being found
because its home is wrong.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant