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

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

Closed
1 task done
Vinfall opened this issue Apr 21, 2023 · 4 comments
Closed
1 task done

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

Vinfall opened this issue Apr 21, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Vinfall
Copy link

Vinfall commented Apr 21, 2023

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 #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 提交的完整哈希

ad396d6

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/版本要求

  • I am using latest commit of MagiskOnWSALocal/我正在使用最新 commit 的版本

Logs/日志

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.
@Vinfall Vinfall added the bug Something isn't working label Apr 21, 2023
@CarlGao4
Copy link
Contributor

CarlGao4 commented Apr 21, 2023

Please use your package manager to install python3-requests then open scripts/install_deps.sh and comment line 132:

python3 -m pip install -r requirements.txt -q

@Vinfall
Copy link
Author

Vinfall commented Apr 22, 2023

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
Copy link
Member

I'm trying to switch to virtual environments

@CarlGao4
Copy link
Contributor

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

@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants