LSPosed / MagiskOnWSALocal

Integrate Magisk root and Google Apps into WSA (Windows Subsystem for Android)
GNU Affero General Public License v3.0
9.6k stars 23.12k forks source link

[Bug] PR #490 breaks script as per PEP 668 #508

Closed Vinfall closed 1 year ago

Vinfall commented 1 year ago

Steps to reproduce/复现步骤

sudo apt update && sudo apt upgrade -y
sudo apt install -y python3-requests
git clone https://github.com/LSPosed/MagiskOnWSALocal
cd ./MagiskOnWSALocal
bash ./scripts/run.sh

Expected behaviour/预期行为

install_deps.sh skips installing requests when installing on system, and run.sh continue without exit (as it used to).

Actual behaviour/实际行为

With https://github.com/LSPosed/MagiskOnWSALocal/pull/490 getting merged, run.sh would now exit on systems with newer Python version (mine is 3.11.2) that includes PEP 668 – Marking Python base environments as “externally managed” with an error when a pip package conflicts with system packages:

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

MagiskOnWSALocal commit full SHA/MagiskOnWSALocal 提交的完整哈希

ad396d6810d8cb87ed8354c89442953e4ab4818a

Linux distribution info/Linux 发行版信息

OS: Devuan GNU/Linux 5 (daedalus/ceres) x86_64 (basically Debian testing/unstable) Kernel: modded 6.1.21.114514-Microsoft-WSL2 Python: 3.11.2 Pip: 23.0.1

Windows version/Windows 版本

1000.25330.1000.0

Build Parameters/构建参数

COMMAND_LINE=--arch x64 --release-type RP --root-sol magisk --gapps-brand MindTheGapps --remove-amazon --compress --magisk-ver stable --compress-format 7z
ln: failed to create symbolic link '/etc/mtab': Permission denied
INFO: Architecture: x64
INFO: Release Type: RP
INFO: Magisk Version: stable
INFO: GApps Brand: MindTheGapps
INFO: GApps Variant: pico
INFO: Root Solution: magisk
INFO: Compress Format: 7z
Build: RELEASE_TYPE=Release Preview

Version requirement/版本要求

Logs/日志

[//]: <> (Don't modify above) ```bash bash ./scripts/run.sh Checking and ensuring dependencies Hit:1 http://deb.devuan.org/merged ceres InRelease Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done ca-certificates is already the newest version (20230311). Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed. See /usr/share/doc/python3.11/README.venv for more information. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. ``` [//]: <> (Don't modify below)
CarlGao4 commented 1 year ago

Please use your package manager to install python3-requests then open scripts/install_deps.sh and comment line 132: https://github.com/LSPosed/MagiskOnWSALocal/blob/ad396d6810d8cb87ed8354c89442953e4ab4818a/scripts/install_deps.sh#L132

Vinfall commented 1 year ago

That's exactly what I did lol. I opened the issue just for the record. Maybe find use another elegant way instead of directly exit when error occurs in scripts/install_deps.sh.

Howard20181 commented 1 year ago

I'm trying to switch to virtual environments

CarlGao4 commented 1 year ago

I think a very simple way is to add python3-requests or py3-requests to requirements