Linux 執行Python指令碼出現:No such file or directory
寫好了一個Python 指令碼後 準備在Linux上面執行。 使用的是 ./test.py 出現了 :No such file or directory
而在使用 python test.py 時卻是可以的。這個非常的讓人費解,於是刷了一下 stack overflow 。原因就是說在指令碼的頭行
#!/usr/bin/env python 中,其實是這樣的#!/usr/bin/env python\r 而\r 會被shell 當成引數,所以可以寫點程式碼來刪除\r
with open('beak', 'rb+') as f: content = f.read() f.seek(0) f.write(content.replace(b'\r', b'')) f.truncate()
還有更加簡單的方法 就是 vi 的時候 先使用 :set ff=unix 在 :wq 儲存 執行即可。
相關推薦
Linux 執行Python指令碼出現:No such file or directory
寫好了一個Python 指令碼後 準備在Linux上面執行。 使用的是 ./test.py 出現了 :No such file or directory 而在使用 python test.py 時卻是可以的。這個非常的讓人費解,於是刷了一下 stack over
執行Linux腳本,出現No Such file or directory異常
退出 linux服務器 腳本開發 win 不存在 存在 src 字符 lin 最近在學習Linux系統的腳本開發,在我編寫完標本的情況出現了以下的情況 這個時候出現了No Such file or directory 情況出現 ,提示文件不存在; 但是通過VIM命令訪問此
arm-none-linux-gnueabi-gcc -v 出現: No such file or directory
太感謝了,我的也是這個問題 交叉編譯環境搭建後 arm-linux-gcc -v 顯示 No such file or directory 使用which命令可以找到,環境變數沒有問題,更詳細的描述問題就是which找到的命令所在的目錄下的所有命令都是同樣的問題。 果然問題的解決點就在我用的是64位系統
Linux下執行可執行檔案出現no such file or directory
有時在linux下執行可執行檔案***.sh出現erro: no such file or dierectory,解決步驟如下: (1)首先檢查路徑以及檔名是否正確; (2)確認是否有執行許可權; (3)檢查檔案格式是否正確,若為dos,需要修改為unix 方法:(3.1)
解決“執行arm-linux-gcc命令,提示No such file or directory”的問題
今天在ubuntu14.04上安裝arm的交叉編譯器arm-linux-gcc,環境變數配置好以後,執行arm-linux-gcc命令,總提示No such file or directory。然後去arm-linux-gcc所在的目錄下,發現不缺少任何檔案。而且環境變數配
Java 呼叫 FFMPEG 命令時用 url 作為輸入源,Linux 下出現 “no such file or directory” 問題的解決
Windows 下執行 ffmpeg 命令, D:/tools/ffmpeg/bin>ffmpeg.exe -i "某視訊檔案下載URL" -f flv D:/1.flv 可以成功直接將下載連結輸入源轉為 1.flv。
64位ubuntu無法安裝32位軟體,或者是執行32位.run等檔案,出現`no such file or directory`問題
64位系統是能安裝32位的應用軟體和程式的,出現問題,最大可能是沒有安裝 32位的依賴庫,或者是安裝的32位依賴庫不對。 linux一般都是在/etc/dpkg/dpkg.cfg.d/路徑下有相關的檔
hdfs dfs -ls後出現No such file or directory解決
原因是因為-ls預設目錄是在hdfs檔案系統的/user/使用者名稱(使用者名稱就命令列@符號前面的那個東西),但是你的hdfs系統內沒有這個資料夾,所以會顯示No such file or directory。 所以你需要在hdfs檔案系統內建立 [email protected
Linux 安裝pyspider 報錯“No such file or directory: 'curl-config”
During handling of the above exception, another exception occurred: Traceback (most recent call last)
qmake: could not exec ‘/usr/lib/x86_64-linux-gnu/qt4/bin/qmake’: No such file or directory
問題:[email protected]:/home/xvv/program/opencvDemo1# qmake -v qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or dir
qmake: could not exec ‘/usr/lib/x86_64-linux-gnu/qt4/bin/qmake’: No such file or directory 解決方案
昨天晚上,第一次用qt,但在編譯時,遇到上述的問題,然後在網上查詢了很多資料,感覺別說的都有道理,但還是不太懂,不過弄了一個多小時後,終於搞定了。 解決方法:首先找到qmake的可執行檔案路徑,我的路徑是/usr/lib/i386-linux-gnu/qt5/bin,在這裡我用的是qt5,我估計
NDK 編譯報錯arm-linux-androideabi-g++: error: CreateProcess: No such file or directory
Android編譯工程時提示:arm-linux-androideabi-g++: error: CreateProcess: No such file or directory錯誤。 解決方法: 步驟1: Android.mk 檔案修改, LOCAL_SHORT_C
bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
yum 安裝一個軟體包,出現如下錯誤; -bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory –查詢python #whereis python python: /usr/bin/
mingw下用gcc編譯c檔案出現no such file or directory解決方法
c檔案直接拖進cmd時地址是對的,但gcc不認空格,所以要把路徑當做所有空格都去掉或改成“—”,這樣它就能直接發現檔案了,這時在cmd中編寫:gcc F:\new.c -o F:\new.exe ,就會出現new.e
Linux 安裝pyspider 報錯“No such file or directory: 'curl-config”
During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string&
Qt5編譯時出現 ---> No such file or directory錯誤解決辦法
解決辦法: 安裝libqt4-devsudo apt-get install libqt4-dev安裝完後開啟qtcreator, 在設定裡面新增qt4版本的qmake. 路徑在 /usr/bin/qmake-qt4. 新增完後把編譯環境那裡也改一改, 然後重新編譯就解
Python.h:No such file or directory
出現No such file or directory的錯誤,有兩種情況,一種是真的沒有Python.h這個檔案,一種是Python的版本不對, 可以進入/usr/include/資料夾下的Python2.x資料夾裡查詢是否有Python.h這個檔案。 如果是第一種情況,那麼
linux下/dev/dsp:No such file or directory解決方法
寫了一個需要通過dsp進行音訊操作的小程式,執行時卻提示/dev/dsp:No such file or directory $ls /dev目錄下並沒有dsp這個檔案解決方法很簡單: $sud
關於shell指令碼提示No such file or directory的解決辦法和原因
在執行剛編寫完的shell指令碼時,報錯現象:解決辦法: vim模式開啟這個shell指令碼,檢視編碼格式後設置成unix編碼 具體操作: vim shellarr.sh開啟指令碼,ctrl+c進入輸入:命令的格式,輸入:set ff?,檢視格
阿里雲centos7 yum命令無效-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory 原因:由於本人伺服器安裝上python3版本後導至liunx找不到自帶的python2版本路徑;