Home  >  Q&A  >  body text

linux - python installation Anaconda environment variables problem to ask

After installing Anaconda on Mac, I configured the environment variable configuration method found online, but I still kept getting an error that conda could not be found.

I entered the Anaconda directory in the terminal:

cd /anaconda
pwd  # /anaconda
source ./bin/activate

# 这样就可以使用 conda 了
conda -V 

But when I want to use conda, I can’t execute the following two commands first every time:

cd /anaconda
source ./bin/activate

I tried configuring source like this in .zshrc but it still didn’t work:

export PATH=”/anaconda/bin:$PATH”

How to configure the environment variables in this case? Trouble.

曾经蜡笔没有小新曾经蜡笔没有小新2713 days ago756

reply all(2)I'll reply

  • 阿神

    阿神2017-05-16 13:35:14

    Environment variables should be written in /etc/profile, add

    in front
    export PATH=”/anaconda/bin:$PATH”

    Then enter

    source /etc/profile

    That’s it. If you only write it in the configuration files of bash and zsh, there may still be errors when calling this PATH in some places.

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:35:14

    Just configure the environment face change in ~/.bash_profile
    No need to configure it in .zshrc
    Once the configuration is complete, use source ~/.bash_profile to process the input to make it effective

    reply
    0
  • Cancelreply