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转换后再执行即可。