Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Mac OSX:找不到bash命令_Python_Macos_Bash - Fatal编程技术网

Python Mac OSX:找不到bash命令

Python Mac OSX:找不到bash命令,python,macos,bash,Python,Macos,Bash,我是个新手——我有一个新的iMac,安装了El Capitan和系统python。我已经安装了几个库,包括xcode工具。在终端中输入bash命令时,会得到以下结果: -bash:$:未找到命令 在echo$PATH上: /Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin 在bash-x-l之后: + '[' -x /usr

我是个新手——我有一个新的iMac,安装了El Capitan和系统python。我已经安装了几个库,包括xcode工具。在终端中输入bash命令时,会得到以下结果:

-bash:$:未找到命令

在echo$PATH上:

/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
在bash-x-l之后:

+ '[' -x /usr/libexec/path_helper ']'
++ /usr/libexec/path_helper -s
+ eval 'PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin";' export 'PATH;'
++ PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin
++ export PATH
+ '[' /bin/bash '!=' no ']'
+ '[' -r /etc/bashrc ']'
+ . /etc/bashrc
++ '[' -z '\s-\v\$ ' ']'
++ PS1='\h:\W \u\$ '
++ shopt -s checkwinsize
++ '[' -r /etc/bashrc_Apple_Terminal ']'
++ . /etc/bashrc_Apple_Terminal
+++ '[' -z '' ']'
+++ PROMPT_COMMAND=update_terminal_cwd
+++ '[' 0 -eq 0 ']'
+++ '[' -n 852F6C5A-22DA-4124-8E2C-21DD219BE5B8 ']'
+++ '[' '!' -e /Users/kwilleford/.bash_sessions_disable ']'
+++ SHELL_SESSION_DID_INIT=1
+++ SHELL_SESSION_DIR=/Users/kwilleford/.bash_sessions
+++ SHELL_SESSION_FILE=/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.session
+++ mkdir -p /Users/kwilleford/.bash_sessions
+++ '[' 1 -eq 1 ']'
+++ SHELL_SESSION_HISTFILE=/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.history
+++ SHELL_SESSION_HISTFILE_NEW=/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.historynew
+++ SHELL_SESSION_HISTFILE_SHARED=/Users/kwilleford/.bash_history
+++ '[' -s /Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.history ']'
+++ PROMPT_COMMAND='shell_session_history_check; update_terminal_cwd'
+++ '[' -r /Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.session ']'
+++ SHELL_SESSION_TIMESTAMP_FILE=/Users/kwilleford/.bash_sessions/_expiration_check_timestamp
+++ trap shell_session_update EXIT
+ PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin
+ export PATH
++ shell_session_history_check
++ '[' 0 -eq 0 ']'
++ SHELL_SESSION_DID_HISTORY_CHECK=1
++ shell_session_history_allowed
++ '[' -n /Users/kwilleford/.bash_history ']'
++ local allowed=0
++ shopt -q histappend
++ allowed=1
++ '[' 1 -eq 1 ']'
++ return 0
++ shell_session_history_enable
++ touch /Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.historynew
++ HISTFILE=/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.historynew
++ SHELL_SESSION_HISTORY=1
++ '[' 'shell_session_history_check; update_terminal_cwd' = shell_session_history_check ']'
++ [[ shell_session_history_check; update_terminal_cwd =~ (.*)(; *shell_session_history_check *| *shell_session_history_check *; *)(.*) ]]
++ PROMPT_COMMAND=update_terminal_cwd
++ update_terminal_cwd
++ local url_path=
++ local i ch hexch LC_CTYPE=C LC_ALL=
++ (( i = 0 ))
++ (( i < 17 ))
++ ch=/
++ [[ / =~ [/._~A-Za-z0-9-] ]]
++ url_path+=/
++ (( ++i ))
++ (( i < 17 ))
++ ch=U
++ [[ U =~ [/._~A-Za-z0-9-] ]]
++ url_path+=U
++ (( ++i ))
++ (( i < 17 ))
++ ch=s
++ [[ s =~ [/._~A-Za-z0-9-] ]]
++ url_path+=s
++ (( ++i ))
++ (( i < 17 ))
++ ch=e
++ [[ e =~ [/._~A-Za-z0-9-] ]]
++ url_path+=e
++ (( ++i ))
++ (( i < 17 ))
++ ch=r
++ [[ r =~ [/._~A-Za-z0-9-] ]]
++ url_path+=r
++ (( ++i ))
++ (( i < 17 ))
++ ch=s
++ [[ s =~ [/._~A-Za-z0-9-] ]]
++ url_path+=s
++ (( ++i ))
++ (( i < 17 ))
++ ch=/
++ [[ / =~ [/._~A-Za-z0-9-] ]]
++ url_path+=/
++ (( ++i ))
++ (( i < 17 ))
++ ch=k
++ [[ k =~ [/._~A-Za-z0-9-] ]]
++ url_path+=k
++ (( ++i ))
++ (( i < 17 ))
++ ch=w
++ [[ w =~ [/._~A-Za-z0-9-] ]]
++ url_path+=w
++ (( ++i ))
++ (( i < 17 ))
++ ch=i
++ [[ i =~ [/._~A-Za-z0-9-] ]]
++ url_path+=i
++ (( ++i ))
++ (( i < 17 ))
++ ch=l
++ [[ l =~ [/._~A-Za-z0-9-] ]]
++ url_path+=l
++ (( ++i ))
++ (( i < 17 ))
++ ch=l
++ [[ l =~ [/._~A-Za-z0-9-] ]]
++ url_path+=l
++ (( ++i ))
++ (( i < 17 ))
++ ch=e
++ [[ e =~ [/._~A-Za-z0-9-] ]]
++ url_path+=e
++ (( ++i ))
++ (( i < 17 ))
++ ch=f
++ [[ f =~ [/._~A-Za-z0-9-] ]]
++ url_path+=f
++ (( ++i ))
++ (( i < 17 ))
++ ch=o
++ [[ o =~ [/._~A-Za-z0-9-] ]]
++ url_path+=o
++ (( ++i ))
++ (( i < 17 ))
++ ch=r
++ [[ r =~ [/._~A-Za-z0-9-] ]]
++ url_path+=r
++ (( ++i ))
++ (( i < 17 ))
++ ch=d
++ [[ d =~ [/._~A-Za-z0-9-] ]]
++ url_path+=d
++ (( ++i ))
++ (( i < 17 ))
++ printf '\e]7;%s\a' file://Kevins-iMac.local/Users/kwilleford
+'['-x/usr/libexec/path\u helper']
++/usr/libexec/path\u helper-s
+eval'PATH=“/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin”;”导出“路径;”
++PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin
++导出路径
+“[”/bin/bash'!=“否”]
+“['-r/etc/bashrc']”
+ . /etc/bashrc
++“['-z'\s-\v\$””
++PS1='\h:\W\u\$'
++shopt-s checkwinsize
++“['-r/etc/bashrc_Apple_Terminal']”
++ . /etc/bashrc_苹果_终端
+++“['-z']”
+++提示符命令=更新终端cwd
+++“['0-等式0']”
+++“['-n 852F6C5A-22DA-4124-8E2C-21DD219BE5B8']”
+++“[”!-e/Users/kwilleford/.bash\u sessions\u disable']
+++SHELL\u SESSION\u DID\u INIT=1
+++SHELL\u SESSION\u DIR=/Users/kwilleford/.bash\u sessions
+++SHELL_SESSION_FILE=/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.SESSION
+++mkdir-p/Users/kwilleford/.bash\u会话
+++“['1-等式1']”
+++SHELL_SESSION_HISTFILE=/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.history
+++SHELL_SESSION_HISTFILE_NEW=/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.historynew
+++SHELL\u SESSION\u HISTFILE\u SHARED=/Users/kwilleford/.bash\u history
+++“['-s/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.history']
+++提示\u命令='shell\u会话\u历史\u检查;更新_终端_cwd'
+++“['-r/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.session']
+++SHELL\u SESSION\u TIMESTAMP\u FILE=/Users/kwilleford/.bash\u sessions/\u expiration\u check\u TIMESTAMP
+++陷阱外壳程序会话更新退出
+PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin
+导出路径
++shell\u会话\u历史记录\u检查
++“['0-等式0']”
++SHELL\u SESSION\u DID\u HISTORY\u CHECK=1
++shell\u会话\u历史记录\u允许
++“['-n/Users/kwilleford/.bash_history']”
++本地允许=0
++shopt-q
++允许=1
++“['1-等式1']”
++返回0
++shell\u会话\u历史记录\u启用
++touch/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.historynew
++HISTFILE=/Users/kwilleford/.bash_sessions/852F6C5A-22DA-4124-8E2C-21DD219BE5B8.historynew
++SHELL_会话_历史记录=1
++“[”shell会话历史检查;更新终端cwd'=shell会话历史检查']
++[[shell_会话_历史记录_检查;更新_终端_cwd=~(.*)(;*shell_会话_历史记录_检查*|*shell_会话_历史记录_检查*)(.*)]
++提示符命令=更新终端cwd
++更新_终端_cwd
++本地url\u路径=
++本地i-ch-hexch-LC\u-CTYPE=C-LC\u-ALL=
++((i=0))
++((i<17))
++ch=/
++[A-Za-z0-9-]]
++url\u路径+=/
++(++i))
++((i<17))
++ch=U
++[U=~[/.[A-Za-z0-9-]]
++url_路径+=U
++(++i))
++((i<17))
++ch=s
++[s=~[/.[A-Za-z0-9-]]
++url_路径+=s
++(++i))
++((i<17))
++ch=e
++[[e=~[/.[A-Za-z0-9-]]
++url_路径+=e
++(++i))
++((i<17))
++ch=r
++[[r=~[/.[A-Za-z0-9-]]
++url_路径+=r
++(++i))
++((i<17))
++ch=s
++[s=~[/.[A-Za-z0-9-]]
++url_路径+=s
++(++i))
++((i<17))
++ch=/
++[A-Za-z0-9-]]
++url\u路径+=/
++(++i))
++((i<17))
++ch=k
++[k=~[/.[A-Za-z0-9-]]
++url_路径+=k
++(++i))
++((i<17))
++ch=w
++[w=~[/.[A-Za-z0-9-]]
++url_路径+=w
++(++i))
++((i<17))
++ch=i
++[[i=~[/.[A-Za-z0-9-]]
++url_路径+=i
++(++i))
++((i<17))
++ch=l
++[l=~[/.[A-Za-z0-9-]]
++url_路径+=l
++(++i))
++((i<17))
++ch=l
++[l=~[/.[A-Za-z0-9-]]
++url_路径+=l
++(++i))
++((i<17))
++ch=e
++[[e=~[/.[A-Za-z0-9-]]
++url_路径+=e
++(++i))
++((i<17))
++ch=f
++[[f=~[/.[A-Za-z0-9-]]
++url_路径+=f
++(++i))
++((i<17))
++ch=o
++[o=~[/.[A-Za-z0-9-]]
++url_路径+=o
++(++i))
++((i<17))
++ch=r
++[[r=~[/.[A-Za-z0-9-]]
++url_路径+=r
++(++i))
++((i<17))
++ch=d
++[d=~[/.[A-Za-z0-9-]]
++url_路径+=d
++(++i))
++((i<17))
++printf'\e]7;%s\a'file://Kevins-iMac.local/Users/kwilleford
我是否需要以某种方式更改路径以查找命令?谢谢


凯文

你好像在键入
$
。这不是bash命令。

当您看到有人编写类似于
$ls something.txt的代码时,美元符号不是命令;这只是一个通用的shell提示符。这意味着“从命令行运行
ls something.txt
”。