sudo: unable to execute ./xxx.py: no such file or directory

$ ./mk_dataset.py

-bash: ./mk_dataset.py: /home/ocean1101/anaconda3/bin/python^M: bad interpreter: No such file or directory


 $ sudo ./mk_dataset.py
  sudo: unable to execute ./mk_dataset.py: No such file or directory
  Hangup

 

这种现象是由于在pycharm中写的代码默认line feed末尾是\n\r的,而unix标准是只有一个\n,因此要将该py文件用dos2unix转换后再执行即可。

原文地址:https://www.cnblogs.com/ocean1100/p/9276154.html

时间: 2024-10-13 04:49:30

sudo: unable to execute ./xxx.py: no such file or directory的相关文章

CentOS中输入yum报错:sudo: unable to execute /bin/yum: No such file or directory

今天尝试更新了下虚拟机CentOS中的python版本后. 运行“yum”命令,就报错:“sudo: unable to execute /bin/yum: No such file or directory” 查询了下网上的资料发现,原来yum调用是用python写的.遂想起刚刚更新python版本,忘了修改yum配置文件了. 解决办法:修改yum配置文件  [[email protected] ~]#vim /usr/bin/yum 把文件头部的#!/usr/bin/python改成#!/u

unable to execute ./start.sh: No such file or directory

刚编写的一个shell文件执行时突然遇到shell文件不能运行,一下子觉得奇了怪了,明明写的shell文件,而且添加了可执行权限,竟然提示这个结果:如下 [[email protected]-2812 opt]$ sudo ./my.sh sudo: unable to execute ./my.sh: No such file or directory 尝试对文件的用vim打开该sh文件,输入:set ff ,显示fileformat=unix,说明没有问题(如果显示fileformat=do

[转]Git – fatal: Unable to create 'XXX/.git/index.lock’: File exists.的解决办法

参考资料: http://sheshui.me/articles/git-quickly-tutorial-20120517 http://stackoverflow.com/questions/9282632/git-index-lock-file-exists-when-i-try-to-commit-but-cannot-delete-the-file 我的说明: 我操作的是ubuntu环境.window远程 1 若在window下远程打开操作窗口(不是console),进入.git目录删

Visual Studio 2013: fatal error C1083: Cannot open include file: 'XXX.h': No such file or directory

So to do this in Visual Studio, open up Solution Explorer, right click on the main project's name and then select Properties. In the window that appears go to Configuration Properties->C/C++->General and in Additional Include Directories add the pat

error: xxx.h: No Such file or directory

名为xxx.h的文件或目录不存在. 注:在#include,#import中指定的文件不存在时会显示此种信息.最可能的原因是,文件名输入错误,好好检查一下文件名. 如果发生这种错误,最好也确认一下实际文件.因为还有可能是文件的检索路径没有指定正确.只要文件是包含在工程的文件夹中都是没有问题的.

CentOS -bash: ./xxx/make: No such file or directory

在安装mpfr时出现以下错误: -bash: ./mpfr-3.1.2/make: No such file or directory [[email protected] opt]# ./mpfr-3.1.2/make -bash: ./mpfr-3.1.2/make: No such file or directory [[email protected] opt]# /opt/mpfr-3.1.2/make -bash: /opt/mpfr-3.1.2/make: No such file

VS2010遇到fatal error C1083: 无法打开预编译头文件:“xxx.pch”: No such file or directory

对C++和VS2010非常不熟悉,但是无奈赶着项目,只能看了点基础就上手,然后就碰到这个问题了. 原因分析: http://bbs.csdn.net/topics/340191697?page=1 编译器一般都是以文件为单位进行编译,如果修改了工程中的一个文件,那么将导致所有文件都要从新编译,这样的编译将耗费很长时间.      为了提高编译速度,将那些不常被修改,比较稳定,文件单独包含到一个指定的头文件中, 然后生成一个预编译头文件 *.pch . VC中默认的头文件为 stdAfx.h, 但

异常Unable to execute dex: Multiple dex files define Lcom/xxx/xxx/xxx

[2015-08-03 11:03:17 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/xxx/xxx/xxx; [2015-08-03 11:03:17 - xxx] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/xxx/xxx/MainActivity; 调试出错,原来是

sudo: unable to resolve host xxx解决办法

问题: [email protected]:~# sudo lsb_release -a sudo: unable to resolve host wiki No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Release: 14.04 Codename: trusty 可见我的主机名为wiki(机器hostname),每次执行sudo 就会出现这个警告sudo: unable