Frist Step of Python Project in ArchLinux
- You can install a python package for the whole system, although it’s not recommended.
sudo pacman -S python-[package name]
- Installing packages for every single project in virual environment is a safer manner.
# create virual environment
cd /path/to/yor/project
python -m venv ./.venv
# active virual environment
source .venv/bin/activate(.fish)
# install python packages in virual environment
pipx install
# deactivate virual environment
deactivate
- If you are in China, use Chinese minor
Add below configuration in ~/.pip/pip.conf
:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple