linux无网络状态下载gunicorn后报 -bash: gunicorn: command not found

首先我的情况是两台生产服务器,都安装了conda环境,但是一台是可以通过pip下载东西(111),另一台不可以(222)。

两台服务器都需要使用到gunicorn插件。用111服务器下载了gunicorn,找到了

将此目录下的gunicorn和gunicorn-20...复制到另一台222服务器相同目录

此时使用 gunicorn -h测试gunicorn使用可以使用时 -bash: gunicorn: command not found 会有错误

解决办法:

1:第一步排除111服务器conda是否设置环境变量

2:到111服务器如下目录

创建与该目录下同样格式的文件(本人采用复制其他文件,然后改名为gunicorn)

然后打开222服务器相同目录找到gunicorn文件,打开复制文件内容,然后黏贴到111对的gunicorn文件内、保存(此目录下的文件我没进行复制没有成功,所以采用这个麻烦的操作流程)

然后111服务器的gunicorn就可以正常使用了

 

根据引用\[1\]和引用\[2\]的内容,当在安装了gunicorn后执行"gunicorn -h"命令时出现"-bash: gunicorn: command not found"错误,这可能是因为gunicorn的可执行文件路径没有正确添加到系统的环境变量中。为了解决这个问题,你可以尝试以下方法: 1. 确保你已经正确安装了gunicorn。可以使用命令"pip list"来查看已安装的包列表,确认gunicorn的版本号是否正确显示。 2. 检查系统的环境变量配置。可以使用命令"echo $PATH"来查看当前的环境变量路径。确保gunicorn的可执行文件所在的路径已经被正确添加到环境变量中。 3. 如果发现gunicorn的可执行文件路径没有被正确添加到环境变量中,你可以手动添加。可以编辑你的bash配置文件(例如~/.bashrc或~/.bash_profile),在其中添加一行类似于"export PATH=$PATH:/path/to/gunicorn"的代码,将"/path/to/gunicorn"替换为gunicorn的实际安装路径。然后保存文件并执行"source ~/.bashrc"或"source ~/.bash_profile"来使配置生效。 4. 重新启动终端窗口或会话,然后再次尝试执行"gunicorn -h"命令,看是否问题已经解决。 希望以上方法能够帮助你解决"gunicorn: 未找到命令"的问题。如果问题仍然存在,请提供更多的信息,以便我们能够更好地帮助你解决。 #### 引用[.reference_title] - *1* [服务器运行gunicorn服务抛错:-bash: gunicorn: command not found](https://blog.csdn.net/weixin_45380689/article/details/129013801)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [安装pip install gunicorn,执行gunicorn -h,显示-bash: gunicorn: command not found](https://blog.csdn.net/vcrookie2008/article/details/130999360)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [解决Linux下安装gunicorn提示-bash: gunicorn: command not found](https://blog.csdn.net/jiduochou963/article/details/88784947)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值