宝塔51特惠活动,企业版1099元/年,送SSL证书,最高立减2万元!查看活动
当前位置:论坛首页 > Linux面板 > 求助

【待反馈】我需安装Python库中的dotenv模块 但用宝塔自带的...

发表在 Linux面板2023-8-2 13:37 [复制链接] 8 2450

本帖最后由 堡塔运维小林 于 2023-8-2 14:22 编辑

我应该怎么做
WechatIMG337.png
使用道具 举报 只看该作者 回复
发表于 2023-8-2 14:22:41 | 显示全部楼层
您好,您点击项目右侧的终端进入项目的虚拟环境中,执行下面的命令,手动按照看看是否正常
  1. pip install dotenv
复制代码
使用道具 举报 回复 支持 反对
发表于 2023-8-2 16:02:41 | 显示全部楼层
堡塔运维小林 发表于 2023-8-2 14:22
您好,您点击项目右侧的终端进入项目的虚拟环境中,执行下面的命令,手动按照看看是否正常
...

我切换到了py3.10  
有一个问题在py3.10在部署运行我的项目的时候无法正确安装 requirements.txt里的依赖
2.9版本是可以正确安装 requirements.txt里的依赖的 但我现在需要3.10的环境
直接提示缺少某个模块 我想用pip安装
我在项目的右边选项里打开终端
却提示我PIP没有安装
[root@ht2022102504170 freegpt-webui]# pip install flask
-bash: pip: command not found
我想着测试py版本 却发现是2.7的 我明明安装的3.10的版本
[root@ht2022102504170 freegpt-webui]# python --version
Python 2.7.5

还有个问题是我安装py3.10的时候提示如下

2023-08-02 15:45:47 (1.28 MB/s) - ‘get-pip.py’ saved [2158605/2158605]

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
ERROR: No matching distribution found for pip
WARNING: You are using pip version 21.2.3; however, version 23.2.1 is available.
You should consider upgrading via the '/www/server/pyporject_evn/344da30168446005d807450a6be0f08f_venv/bin/python3 -m pip install --upgrade pip' command.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
ERROR: No matching distribution found for pip
WARNING: You are using pip version 21.2.3; however, version 23.2.1 is available.
You should consider upgrading via the '/www/server/pyporject_evn/344da30168446005d807450a6be0f08f_venv/bin/python3 -m pip install --upgrade pip' command.
说是
使用道具 举报 回复 支持 反对
发表于 2023-8-2 16:07:55 | 显示全部楼层
简单说明一下 就是我想安装一个py项目 我在网站选项里安装py3.10 但安装末尾有警告 警告如上
我在部署程序的时候  发现py3.10直接跳过了安装依赖的步骤运行项目失败
于是我想着直接用pip装依赖 于是我点击了右边的终端选项
我打开终端之后打算用pip安装依赖的时候 liunx提示pip没有安装 并且py版本是2.7的版本
大概就是这么个步骤
使用道具 举报 回复 支持 反对
发表于 2023-8-2 16:09:24 | 显示全部楼层
堡塔运维小林 发表于 2023-8-2 14:22
您好,您点击项目右侧的终端进入项目的虚拟环境中,执行下面的命令,手动按照看看是否正常
...

您好!我已进入终端 不正常
简单说明一下 就是我想安装一个py项目 我在网站选项里安装py3.10 但安装末尾有警告 警告如上
我在部署程序的时候  发现py3.10直接跳过了安装依赖的步骤运行项目失败(2.9的py能够安装依赖 但我需要3.10)
于是我想着直接用pip装依赖 于是我点击了右边的终端选项
我打开终端之后打算用pip安装依赖的时候 liunx提示pip没有安装 并且py版本是2.7的版本
大概就是这么个步骤
使用道具 举报 回复 支持 反对
发表于 2023-8-2 16:19:36 | 显示全部楼层
宝塔用户_pwsxho 发表于 2023-8-2 16:02
我切换到了py3.10  
有一个问题在py3.10在部署运行我的项目的时候无法正确安装 requirements.txt里的依赖 ...

您好,私信我您的todesk或者向日葵,我远程看看,私信后这里回复一下
使用道具 举报 回复 支持 反对
发表于 2023-8-2 16:24:59 | 显示全部楼层
堡塔运维小林 发表于 2023-8-2 14:22
您好,您点击项目右侧的终端进入项目的虚拟环境中,执行下面的命令,手动按照看看是否正常
...

ssssddd.png
安装依赖的时候报ssl错误
使用道具 举报 回复 支持 反对
发表于 2023-8-2 16:39:16 | 显示全部楼层
堡塔运维小林 发表于 2023-8-2 16:19
您好,私信我您的todesk或者向日葵,我远程看看,私信后这里回复一下

已私信了。。。。。。
使用道具 举报 回复 支持 反对
发表于 2024-3-23 10:29:45 | 显示全部楼层
您好,这个问题解决了吗
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析
快速回复 返回顶部 返回列表