如何确保 cPanel 应用程序管理器中的 Python 依赖项成功执行

问题描述 投票:0回答:1

当我想“确保 Python 应用程序的依赖关系”时,我收到以下错误消息:

The system couldn’t ensure dependencies for your application. For more information, see the instructions below. The process failed. Run the following command from the command line:

cd /home/henridev/dummy && /usr/bin/pip3.6 install --user -r requirements.txt

我可以从终端手动配置我的虚拟环境并成功安装所有依赖项。

但是,当尝试从网站浏览器访问我的应用程序时,仍然出现错误,导致我的模块无法成功导入。 例如:

ModuleNotFoundError: No module named 'uvicorn'

怀疑这是因为尽管手动配置了Python虚拟环境,“确保依赖关系”仍然没有成功执行。

在 cPanel 中,我只有“应用程序管理器”可用。不是“安装 Python 应用程序”功能。由于

uvicorn
至少需要 Python 3.8 才能成功运行,所以事情变得很复杂。然而,我的
usr/bin
中最新的Python3版本是Python3.6。

另一方面,我也尝试过:

echo 'source scl_source enable rh-python38' >> ~/.bashrc
echo 'source scl_source enable rh-python38' >> ~/.bash_profile

确保每个shell会话都使用Python3.8作为默认的Python3解释器。但这并没有解决问题。

python-3.x pip virtualenv cpanel passenger
1个回答
0
投票

你能解决这个问题吗?我有同样的问题:c

© www.soinside.com 2019 - 2024. All rights reserved.