ubuntu 22.04 server python3 包 LTS
sudo apt install -y python3-pip
不同的用户的,包的 安装位置不一样
系统默认目录 /usr/lib/python3/dist-packages
然后每个用户 各自的目录是
/home/mike/.local/lib/python3.10/site-packages
sudo apt install -y python3-pip
pip3 install pandas
sudo pip install requests
sudo pip install --upgrade pip
sudo apt update
sudo apt install python3-pip
pip show pyserial
pip show pandas
这个包是 安装在 用户自己的目录里面
Location: /home/mike/.local/lib/python3.10/site-packages
Requires: numpy, python-dateutil, pytz, tzdata
Required-by:
pip show pyserial
pyserial 是 系统默认安装的
这个包是 安装在 系统默认的目录里面
Name: pyserial
Version: 3.5
Summary: Python Serial Port Extension
Home-page: https://github.com/pyserial/pyserial
Author: Chris Liechti
Author-email: cliechti@gmx.net
License: BSD
Location: /usr/lib/python3/dist-packages
Requires:
Required-by:
pytest 不是系统默认安装的
sudo pip install pytest
pip show pytest
位于 /usr/local/lib/python3.10/dist-packages
上面的是 位于
/usr/lib/python3/dist-packages
如果不是 sudo 安装的
会位于
/home/mike/.local/lib/python3.10/site-packages
Name: pytest
Version: 8.3.4
Summary: pytest: simple powerful testing with Python
Home-page:
Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin, Others (See AUTHORS)
Author-email:
License: MIT
Location: /usr/local/lib/python3.10/dist-packages
Requires: exceptiongroup, iniconfig, packaging, pluggy, tomli
Required-by:
加快 python pip 安装 速度
python 虚拟环境
python3 -m venv env
source env/bin/activate