centos 7にanaconda-2.5.3をインストールした後、yumとgnomeは機能しません。

centos 7にanaconda-2.5.3をインストールした後、yumとgnomeは機能しません。

通常、以下のようにシェルコマンドでインストールします。

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

次に、再ロードシェル変数を入力します。

source ~/.bashrc

おすすめ記事