前提・実現したいこと
$ source activate Python3 pyenv: activate: command not found
仮想環境を利用しようとした時、上記のようにpyenvがpathを使用しているためsource activateが使えなかったので、pyenvとanacondaを共存させる時のactivate衝突問題の回避策3種類 - Qiita
に乗っ取ってpyenv経由でanacondaを導入しようとしました。
しかし1,2では正常に動作しなかったため、conda activate
を利用しました。
初回時に初期設定を行うようなエラーメッセージが出てきたので従って~/.bash_profileに変更を加えましたが同じエラーメッセージが出続けるような状況です。
pyenv+anacondaでデフォルトの環境を変更する | CodeLab技術ブログも参考にしましたが、変更部分が~/.bash_profileでなく~/.bashrcであったりとバージョンによって違うのか変更箇所が異なっています。
エラーメッセージ
$ conda activate CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. If your shell is Bash or a Bourne variant, enable conda for the current user with $ echo ". /Users/yuichikato/.pyenv/versions/anaconda3-5.2.0/etc/profile.d/conda.sh" >> ~/.bash_profile or, for all users, enable conda with $ sudo ln -s /Users/yuichikato/.pyenv/versions/anaconda3-5.2.0/etc/profile.d/conda.sh /etc/profile.d/conda.sh The options above will permanently enable the 'conda' command, but they do NOT put conda's base (root) environment on PATH. To do so, run $ conda activate in your terminal, or to put the base environment on PATH permanently, run $ echo "conda activate" >> ~/.bash_profile Previous to conda 4.4, the recommended way to activate conda was to modify PATH in your ~/.bash_profile file. You should manually remove the line that looks like export PATH="/Users/yuichikato/.pyenv/versions/anaconda3-5.2.0/bin:$PATH" ^^^ The above line should NO LONGER be in your ~/.bash_profile file! ^^^
試したこと
上記の指示通り、一通り追記等を行いましたが、変化がないようです。
該当しそうなファイルの現状のソースコード
######~/.bash_profile
# added by Anaconda3 5.0.1 installer # Setting PATH for Python 3.7 # The original version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}" export PATH eval "$(pyenv init -)" . /Users/yuichikato/.pyenv/versions/anaconda3-5.2.0/etc/profile.d/conda.sh conda activate
######~/.bashrc
export PATH="$PYENV_ROOT/versions/anaconda3-2.5.0/bin/:$PATH"
######~/.zshrc
(未記入でした)
補足情報(FW/ツールのバージョンなど)
conda : 4.5.4
pyenv : anaconda3-5.2.0
$ pyenv versions system 3.6.0 3.6.3 3.6.6 3.7.0 3.7.0/envs/TensorFlow TensorFlow * anaconda3-5.2.0 (set by /Users/yuichikato/.pyenv/version) anaconda3-5.2.0/envs/py363
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/16 06:48 編集