astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.5k stars 460 forks source link

rye sync on sudo failed #797

Closed oligamiq closed 6 months ago

oligamiq commented 6 months ago

Steps to Reproduce

RUN

sudo `which rye` sync

Expected Result

ok

Actual Result

󰣚 raspberrypi  …/2023_SIP_lawnmower   main $!?   v1.76.0  v3.11.2   20:24   sudo ./daemon.sh Bootstrapping rye internals Found a compatible Python version: cpython@3.12.2 × Querying Python at /root/.rye/py/cpython@3.12.2/install/bin/python3.12 failed with status exit status: │ 1: │ --- stdout:

│ --- stderr: │ Could not find platform independent libraries │ Python path configuration: │ PYTHONHOME = (not set) │ PYTHONPATH = (not set) │ program name = '/root/.rye/py/cpython@3.12.2/install/bin/python3.12' │ 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 = '/root/.rye/py/cpython@3.12.2/install/bin/python3.12' │ sys.base_prefix = '/install' │ sys.base_exec_prefix = '/root/.rye/py/cpython@3.12.2/install' │ sys.platlibdir = 'lib' │ sys.executable = '/root/.rye/py/cpython@3.12.2/install/bin/python3.12' │ sys.prefix = '/install' │ sys.exec_prefix = '/root/.rye/py/cpython@3.12.2/install' │ sys.path = [ │ '/install/lib/python312.zip', │ '/install/lib/python3.12', │ '/root/.rye/py/cpython@3.12.2/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 0x0000007f8a8cb040 (most recent call first): │ │ --- error: failed to sync ahead of run

Caused by: 0: could not sync because bootstrap failed 1: Failed to create self venv using /root/.rye/py/cpython@3.12.2/install/bin/python3. uv exited with status: exit status: 1

Version Info

 rye --version rye 0.27.0 commit: 0.27.0 (43ee4fce0 2024-02-26) platform: linux (aarch64) self-python: cpython@3.12 symlink support: true uv enabled: true

Stacktrace

No response

mitsuhiko commented 6 months ago

Running rye as super user is definitely not advised and not supported. You should always run this as local user.

oligamiq commented 6 months ago

Do you intend to display a special message?