在centos 7中安装anaconda-2.5.3后,yum和gnome无法工作

在centos 7中安装anaconda-2.5.3后,yum和gnome无法工作

通常我从 shell 命令进行安装,如下所示。

sh Anaconda2-5.3.0-Linux-x86_64.sh

安装后我意识到 python 包的一些依赖项yum丢失了。因此正常命令yum不起作用..并将错误显示为

Python 2.7.15 |Anaconda, Inc.| (default, May  1 2018, 23:32:55) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[bhanuchander@master dailymail]$ yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.15 |Anaconda, Inc.| (default, May  1 2018, 23:32:55) 
[GCC 7.2.0]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

并且 python 正常导入显示错误为,

>>$ python -c 'import yum'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named yum

如果我重新启动系统,gnome 无法工作并显示Oops some thing gone Wrong.去掉后anaconda工作正常...

  • 这里发生了什么事?以及如何解决这个问题?

答案1

安装 anaconda 软件包时,安装完成后您将收到以下输出:

Output
...
installation finished.
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/hostname/.bashrc ? [yes|no]
[no] >>> 

类型no

安装完成后。/path/to/anaconda/bin/然后转到删除python文件。现在,将Anaconda3安装位置附加到~/.bashrc.

vi ~/.bashrc

将此行添加到文件中:

export PATH=$HOME/path/to/anaconda/bin:$PATH  

:wq

现在,输入 reload shell 变量:

source ~/.bashrc

相关内容