1. 报错:-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

python多版本造成额问题 找不到python的路径 所以保持

-查找python

whereis python

python: /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.4 /usr/local/bin/python2.7 /usr/local/bin/python /usr/local/bin/python2.7-config /usr/local/lib/python2.7 /usr/share/man/man1/python.1.gz

查找yum

whereis yum

yum: /usr/bin/yum /etc/yum.conf /etc/yum /usr/share/man/man8/yum.8.gz

vim /usr/bin/yum

将首行的#!/usr/bin/python
更改成 #!/usr/bin/python2.4

保存退出!

执行yum intall时遇到下面的错误决绝方法同上:修改 /usr/libexec/urlgrabber-ext-down 中文/usr/bin/python

Loaded plugins: fastestmirror
Determining fastest mirrors
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
SyntaxError: invalid syntax
Exiting on user cancel

2. Django项目遇到 ModuleNotFoundError: No module named ‘MySQLdb’

在 模板目录下的__init__.py文件添加:

import pymysql
pymysql.install_as_MySQLdb()

3. Django数据库连接遇到:django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

报错:-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directorypython多版本造成额问题 找不到python的路径 所以保持-查找pythonwhereis pythonpython: /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.4 /usr/local/bin/python2.7 /usr/local/bin/python /us
报错:-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory python多版本造成额问题 找不到python的路径 所以保持 -查找python#whereis pythonpython: /usr/bin/python /usr/bin/python2.4 /usr/li...
rpm -ivh --nodeps http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm rpm -ivh --nodeps http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm rpm -ivh --no
简介: 本文主要为大家讲解CentOS 7系统中执行yum命令失败等常见问题的排查方法。 1. 执行yum命令报404错误 1)检查yum仓库是否配置正确,可以到CentOS 镜像下载阿里云repo配置文件。 2)如果报错中包含$releasever变量, 则执行rpm -qa | grep centos-release确认centos-release是否安装。未安装可以执行以下命令下载安装包进行安装。 wget https://mirrors.aliyun.com/centos/7/os/x86_64/P
今天升级公司产品,结果安装过程中要用到yum,结果yum命令执行报错:“-bash: /usr/bin/yum: /usr/bin/python3.7: bad interpreter: No such file or directory” 查看python版本(which python),系统安装的是python3.6。看错误提示的意思,yum需要用pthon3.7作为解释器。 故需要升级py...
执行docker命令报错-bash: /usr/bin/docker: /bin/sh: bad interpreter: No such file or directory 原因分析:/bin目录下的sh命令出问题了 解决办法: 1、cd/bin目录下,查看sh命令,发现不存在 2、从其他服务器上面拷贝sh到/bin目录下 3、再次执行docker命令报错Permission den...
删除了yum文件,导致yum命令出现-bash情况: [root@localhost ~]# yum -bash: /usr/bin/yum: No such file or directory http://mirrors.163.com/centos --网站内根据自己系统版本 rpm包在/Packages/目录下 yum-3.4.3-168.el7.centos.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
执行yum install的时候出现错误提示 -bash: /usr/bin/yum: /usr/bin/python3: bad interpreter: No such file or directory 错误原因是找不到python3文件夹,原因是安装其他软件导致python版本和yum配置里到pyhon版本不一致,所以yum找不到pyhon执行文件。 服务器上之前安装过一个3.5版本...