我有一个两天前使用OS X Mavericks的Mac Pro,需要让doc2dash正常工作。
我已经安装了Python,pip和doc2dash,但在终端中键入“doc2dash”时出现以下错误。
-bash: doc2dash: command not found
以下是我的.bash_profile
文件:
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc
#[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
##
# Your previous /Users/USERNAME/.bash_profile file was backed up as /Users/USERNAME/.bash_profile.macports-saved_2014-03-08_at_02:37:54
##
# MacPorts Installer addition on 2014-03-08_at_02:37:54: adding an appropriate PATH variable for use with MacPorts.
#export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
根据评论编辑:
doc2dash
什么都不返回。
当我运行'sudo pip install --user doc2dash'时,会出现以下内容:
Requirement already satisfied (use --upgrade to upgrade): doc2dash in /Users/USERNAME/Library/Python/2.7/lib/python/site-packages Cleaning up...
当我在上面的目录中列出doc2dash文件时,会出现以下内容:
drwxr-xr-x 9 USERNAME staff 306 Mar 8 02:28 doc2dash
drwxr-xr-x 9 USERNAME staff 306 Mar 8 02:28 doc2dash-1.2.0.dist-info
doc2dash不在/ usr / local / bin中。
有人可以告诉我该怎么做以使这个命令起作用吗?
答案 0 :(得分:3)
pip install --user
将命令安装到~/Library/Python/2.7/bin
。更新您的.bash_profile
以包含该行:
export PATH="$HOME/Library/Python/2.7/bin:/usr/local/bin:$PATH"
然后打开一个新终端,shell将能够找到doc2dash
。