这类错误有两种表现形式:
1、-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
这个错误是因为python的版本不匹配,只要在/usr/bin/yum中把第一行的#!/usr/bin/python改成#!/usr/bin/python2.4就可以啦~
当然,我是指路径对的情况下,毕竟通常linux下的python默认版本都是2.4,当然,例外不算。
2、-bash: /usr/bin/yum: /usr/bin/python^M: bad interpreter: No such file or directory
有些时候,错误是这样显示的,那就不是python的版本问题了,属于编码问题。
因为windows下的换行默认的是“换行+回车”,也就是“\n\r”,而linux下的换行默认的是“换行”,也就是“\n”,
所以在windows下对yum进行修改的时候后面的“\r”linux是不认识的,会被默认成路径的一部分,显示出来就是“^M”.
所以这个问题的修改办法就是改变yum文件的编码
1)在windows下转换:
利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行。转换方式如下(UltraEdit):File-->Conversions-->DOS->UNIX即可。
2)也可在Linux中转换:
首先要确保文件有可执行权限
#sh>chmod a+x filename
然后修改文件格式
#sh>vi filename
利用如下命令查看文件格式
:set ff 或 :set fileformat
可以看到如下信息
fileformat=dos 或 fileformat=unix
利用如下命令修改文件格式
:set ff=unix 或 :set fileformat=unix
:wq (存盘退出)
最后再执行文件
#sh>./filename
相关推荐
主要介绍了bash: /usr/bin/autocrorder: /usr/bin/python^M: bad interpreter: No such file or directory,需要的朋友可以参考下
在本篇文章里小编给大家整理的是关于linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方法,有需要的朋友们参考下。
-bash: /usr/local/jdk/jdk1.8.0_181/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 安装完后 java -version 查看版本出现: 原因是:没有那个文件或目录,找了很久发现需要...
CentOS7安装VMware Tools 在安装VMware-tools出现bash:./vmware-install.pl :/usr/bin/perl:bad interpreter:No such file or directory.处理方式
python库。 资源全名:django-python-interpreter-0.0.1.tar.gz
Interpreter(解释器)模式.doc
2. Using the Python Interpreter 使用 Python 解释器 ................... 2.1. Invoking the Interpreter 调用解释器 ............................ 2.1.1. Argument Passing 参数传递 .............................
python库。 资源全名:robotframework-interpreter-0.6.4.tar.gz
资源分类:Python库 所属语言:Python 资源全名:vapl_interpreter-0.1.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
or Python 3 . The app can also be run under Kivy on the desktop (Linux, OS X/macOS, Windows). The Pyonic interpreter user interface is created in Python using Kivy . User input is passed to a second ...
资源分类:Python库 所属语言:Python 资源全名:robotframework-interpreter-0.3.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
vim自动提示等多种功能 先安装ctags 然后进入./vim文件中执行 sh vim_... /bin/bash: /usr/bin/ctags: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory^@ 解决办法 sudo yum install glibc.i686
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
500 Lines or Less _ A Python Interpreter Written in Python
What's different about it, compared to other interpreter or compiler literature? - Working code is the focus. Code is not just found in the appendix. Code is the main focus of this book. - It's ...
./m_daemon_setup: ./m_agent_daemon: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory m_agent_daemon: error while loading shared libraries: libstdc++.so.5: cannot open shared object ...
初次安装完PyCharm后,新建项目时,遇到了No Python interpreter selected的问题。 意思是说没有找到Python解释器。那我们添加Python解释器即可。 Python–Preferences–Project Interpreter–Python Interpreter ...
A JavaScript interpreter in Go (golang)