install crypto in sage of wsl

When I input sudo -pip install pycryptodome

It output

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
root@LAPTOP-LDQVJGQS:/mnt/c/Users/coper# python3 -m pip install --user pipx
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.
root@LAPTOP-LDQVJGQS:/mnt/c/Users/coper#

Just translate it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
root@LAPTOP-LDQVJGQS:/mnt/c/Users/coper/Desktop# sage --pip install pycrypto
error: externally-managed-environment

× 该环境由外部管理
╰─> 要在全系统安装 Python 软件包,请尝试使用 apt install
python3-xyz,其中 xyz 是要安装的软件包。
安装。

如果您想安装非 Debian 打包的 Python 软件包、
使用 python3 -m venv path/to/venv 创建一个虚拟环境。
然后使用 path/to/venv/bin/python 和 path/to/venv/bin/pip。确保
确保安装了 python3-full。

如果您想安装非 Debian 打包的 Python 应用程序、
最简单的方法是使用 pipx install xyz,它会为您管理一个
虚拟环境。请确保已安装 pipx。

更多信息请参见 /usr/share/doc/python3.11/README.venv。

注意:如果您认为这是一个错误,请联系您的 Python 安装或操作系统发行提供商。您可以通过 --break-system-packages 来覆盖此选项,但可能会破坏您的 Python 安装或操作系统。
提示:详细规范请参见 PEP 668。

I choose ignore it and input sage --pip install pycryptodome --break-system-packages

In this way, we succeed.

1
2
3
4
5
6
7
8
root@LAPTOP-LDQVJGQS:/mnt/c/Users/coper/Desktop# sage --pip install pycryptodome --break-system-packages
Collecting pycryptodome
Downloading pycryptodome-3.20.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 93.7 kB/s eta 0:00:00
Installing collected packages: pycryptodome
Successfully installed pycryptodome-3.20.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@LAPTOP-LDQVJGQS:/mnt/c/Users/coper/Desktop#