[英]Conda command not found in Google Cloud VM
I have a problem with Anaconda3 in Google Cloud VM with Ubuntu.我在使用 Ubuntu 的 Google Cloud VM 中使用 Anaconda3 时遇到问题。 I installed Anaconda3 successfully, but I cannot call conda.
我成功安装了 Anaconda3,但无法调用 conda。 Here is code from my terminal.
这是来自我的终端的代码。
eko_rudiawan@google-ubuntu:~$ $PATH
-bash: /home/eko_rudiawan/bin:/home/eko_rudiawan/.local/bin:/opt/ros/kinetic/bin:/usr/local/sbin:/usr/local/bin:/us
r/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: No such file or directory
eko_rudiawan@google-ubuntu:~$ which python
/usr/bin/python
eko_rudiawan@google-ubuntu:~$ export PATH="/home/eko_rudiawan/anaconda3/bin:$PATH"
eko_rudiawan@google-ubuntu:~$ which python
/home/eko_rudiawan/anaconda3/bin/python
eko_rudiawan@google-ubuntu:~$ conda --version
conda: command not found
eko_rudiawan@google-ubuntu:~$
My suggestion is to start from the begging.我的建议是从乞讨开始。 I had the same issue in my VM and I fixed with these steps:
我在我的 VM 中遇到了同样的问题,我通过以下步骤进行了修复:
$ ls
command to see if the anaconda3 directory is there$ ls
命令查看anaconda3目录是否存在$ rm -rf anaconda3
.$ rm -rf anaconda3
。 This will force to delete the directory and all its data.$ exit
to exit the VM or close the window to terminate session.$ exit
退出 VM 或关闭窗口终止会话。$ cd /tmp
$ curl -O https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
$ sha256sum Anaconda3-5.2.0-Linux-x86_64.sh
Output
09f53738b0cd3bb96f5b1bac488e5528df9906be2480fe61df40e0e0d19e3d48 Anaconda3-5.2.0-Linux-x86_64.sh
$ bash Anaconda3-5.2.0-Linux-x86_64.sh
ENTER
.ENTER
。 Keep pressing enter until the first question comes up.yes
hit ENTER . yes
点击ENTER 。Anaconda3 will now be installed into this location:
/home/[YOUR_USERNAME]/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/[YOUR_USERNAME]/anaconda3] >>>
yes
hit ENTER . yes
点击ENTER 。Thank you for installing Anaconda3!
Thank you for installing Anaconda3!
no
and hit ENTER . no
并按 ENTER 。$ cd
$ cd
转到主目录$ ls
.$ ls
。 You should see the anaconda3
directory there.anaconda3
目录。$ source anaconda3/bin/activate
$ source anaconda3/bin/activate
来激活 anaconda 环境(base) [YOUR_USERNAME]@ubuntu-linux-os:~$
.(base) [YOUR_USERNAME]@ubuntu-linux-os:~$
。 Which (base) means you are inside that environment.$ conda --version
$ conda --version
conda 4.5.4
response.conda 4.5.4
响应。conda --version
and you should see the anaconda's version.conda --version
,您应该会看到 anaconda 的版本。Old question but I just encountered the same issue.老问题,但我刚刚遇到了同样的问题。 I only needed to do step 19 to get conda to work.
我只需要执行第 19 步即可让 conda 工作。 No need to start over.
无需重新开始。 However the fix didn't stick - had to repeat on next terminal session.
然而,修复没有坚持 - 必须在下一个终端会话中重复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.