Pony of Shadows

Queen of Truth & King of Practice


Frist Step of Python Project in ArchLinux

  1. You can install a python package for the whole system, although it’s not recommended.
sudo pacman -S python-[package name]
  1. 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
  1. 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