找不到conda命令。然而.profile和“echo $ PATH”似乎没问题

时间:2016-10-14 08:29:23

标签: python anaconda conda .profile

我盲目地安装了很多次Python,当然不知道我在安装什么,在哪里。我想在我遇到更多问题之前,我需要整理一下环境。在终端中,我使用命令which -a python并提出了这个:

/opt/local/bin/python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
~/anaconda/bin/python
/opt/local/bin/python
/opt/local/bin/python
/opt/local/bin/python
/usr/bin/python

我的.profile有:

export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
export PATH="/opt/local/bin:/opt/local/sbin:/opt/local/lib/gmt4/bin:$PATH"
export PATH="~/teqc:$PATH"
export PATH="/usr/local/runpkr000:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
##
# Your previous ~/.profile file was backed up as ~/.profile.macports-saved_2015-04-02_at_16:40:23
##
# MacPorts Installer addition on 2015-04-02_at_16:40:23: 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.
# added by Anaconda 2.3.0 installer
export PATH="~/anaconda/bin:$PATH"

echo $PATH给出了:

~/anaconda/bin:/opt/local/bin:/opt/local/sbin:/usr/local/runpkr000:~/teqc:/opt/local/bin:/opt/local/sbin:/opt/local/lib/gmt4/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/Library/TeX/texbin:/usr/texbin

我似乎找不到问题所在。我已经在我的MBP上使用熊猫,numpy,matplotlib,scipy超过一年了,而且一切似乎工作正常(实际上,import pandas总是突出显示为红色,但无论如何它仍然有效)。我已经使用Macports和Anacondas进行安装(从which -a python可以看出,似乎),并且只是意识到只需要使用其中一个。我对如何配置.profile感到困惑,并且通常想整理这个烂摊子。我的目标是然后使用conda安装另一个库(在本例中为obspy)。

2 个答案:

答案 0 :(得分:1)

我遵循link的建议 基本上他告诉我使用.sh变体而不是.pkg安装anaconda,它对我有用。

答案 1 :(得分:0)

您好,而不是重新安装所有内容,您可以添加符号链接到conda(假设您的.profile或.bash_profile中的一切都很好)。 我做了以下工作并为我工作:

ln -s "Applications/anaconda/bin/conda" /usr/local/bin/conda 

希望这会有所帮助 附:在OSX上工作