宝塔命令行 paramiko模块不存在且安装失败,请联系宝塔官方人员! 解决办法

宝塔 更新到最新 11.0.0 发现命令行 paramiko模块不存在且安装失败

提示:paramiko模块不存在且安装失败
在这里插入图片描述

宝塔python 有一个专门的命令 btpip install pyOpenSSL


有的执行会报这个错误

[root@iZd1t3wexueebwZ ~]# btpip install pyOpenSSL
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting pyOpenSSL
  Using cached https://mirrors.aliyun.com/pypi/packages/80/28/2659c02301b9500751f8d42f9a6632e1508aa5120de5e43042b8b30f8d5d/pyopenssl-25.1.0-py3-none-any.whl (56 kB)
Collecting cryptography<46,>=41.0.5
  Using cached https://mirrors.aliyun.com/pypi/packages/b9/cf/84210c447c06104e6be9122661159ad4ce7a8190011669afceeaea150524/cryptography-45.0.5-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.4 MB)
Requirement already satisfied: cffi>=1.14 in /www/server/panel/pyenv/lib/python3.7/site-packages (from cryptography<46,>=41.0.5->pyOpenSSL) (1.15.1)
Requirement already satisfied: pycparser in /www/server/panel/pyenv/lib/python3.7/site-packages (from cffi>=1.14->cryptography<46,>=41.0.5->pyOpenSSL) (2.21)
Installing collected packages: cryptography, pyOpenSSL
  Attempting uninstall: cryptography
    Found existing installation: cryptography 3.2.1
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] 没有那个文件或目录: '/www/server/panel/pyenv/lib/python3.7/site-packages/cryptography-3.2.1.dist-info/RECORD'

WARNING: You are using pip version 20.3.3; however, version 24.0 is available.
You should consider upgrading via the '/www/server/panel/pyenv/bin/python3.7 -m pip install --upgrade pip' command.

步骤 1:手动清理旧版本cryptography残留文件
由于自动卸载失败,需要手动删除旧版本的残留文件:
bash

删除旧版本cryptography的安装目录

rm -rf /www/server/panel/pyenv/lib/python3.7/site-packages/cryptography-3.2.1.dist-info/
rm -rf /www/server/panel/pyenv/lib/python3.7/site-packages/cryptography/

步骤 2:强制安装兼容版本的cryptography
pyOpenSSL需要cryptography<46,>=41.0.5,直接安装这个范围的版本:
bash

使用宝塔环境的pip手动指定安装cryptography

/www/server/panel/pyenv/bin/pip3.7 install "cryptography>=41.0.5,<46" -i https://mirrors.aliyun.com/pypi/simple --force-reinstall

–force-reinstall参数会强制重新安装,忽略之前的残留问题。
步骤 3:重新安装pyOpenSSL
完成cryptography安装后,再安装pyOpenSSL:
bash

btpip install pyOpenSSL -i https://mirrors.aliyun.com/pypi/simple

步骤 4:(可选)升级宝塔环境的 pip
如果后续仍有警告,可按提示升级当前环境的 pip:
bash

/www/server/panel/pyenv/bin/python3.7 -m pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple

在这里插入图片描述
搞定

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小*-^-*九

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值