离线升级pip3
python3 -m pip install --upgrade pip-23.0.1-py3-none-any.whl
ModuleNotFoundError: No module named '_bz2'
sudo apt-get install libbz2-dev
cd /usr/local/lib/python3.8/lib-dynload
_gdbm.cpython-38-x86_64-linux-gnu.so
下载链接: https://pan.baidu.com/s/1IjjhZARh3VGLhNFNPaE2QQ 提取码: disj
cd /usr/local/lib/python3.8/
_bz2.cpython-38m-x86_64-linux-gnu.so
下载链接: https://pan.baidu.com/s/1wYCStYo9WKGca1pXqq9vsg 提取码: qgk6
我们在使用 pip 安装 python 包时,经常会出现如下错误:
ERROR: Could not find a version that satisfies the requirement xxxx(from versions: none)
ERROR: No matching distribution found for xxxx
找了很久终于找到能解决这种报错的方法了。
直接选用pip源并且信任它的来源就可以解决这种问题。
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
yum -y install gcc automake autoconf libtool make
yum -y install libffi-devel
pip3 install --upgrade setuptools
pip3 install 库包名 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
问题一:安装时报错ModuleNotFoundError: No module named '_ctypes'的解决办法
1、执行如下命令:
yum install libffi-devel
apt-get install libffi-devel
2、从 "./configure --prefix=/usr/local/python3 --with-ssl" 重新安装
问题二:pip3 install时报错“pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.”
先安装openssl-dev,然后重新编译安装,只是在编译的过程中加入 --enable-optimizations
ubuntu:
sudo apt-get install libffi-dev
或者
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
sudo apt-get install libssl-dev openssl
sudo apt-get install libffi-dev
centos7
yum install libffi-devel -y
错误三、Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package lrzsz
sudo apt-get update
sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository restricted
sudo add-apt-repository multiverse