openSUSE 安装 Anaconda3 之后出现Could not start D-Bus. Can you call qbus-qt5?

openSUSE 安装 Anaconda3 之后出现Could not start D-Bus. Can you call qbus-qt5?

本来想学一下Python,就下了个Anaconda来玩。一路安装下来,安装的时候选择了将Anaconda添加到PATH中去,撸了一天代码也没有什么问题,结果第二天开机的时候就悲剧了:

Could not start D-Bus. Can you call qbus-qt5?
点确定就黑屏了。。。

系统版本:

lk@k:~> lsb_release -a
LSB Version:    n/a
Distributor ID: openSUSE project
Description:    openSUSE Leap 42.3
Release:        42.3
Codename:       n/a

Anaconda:

          conda version : 4.5.0
    conda-build version : 3.4.1
         python version : 3.6.4.final.0

身为linux小白的我各种搞来搞去最后发现只有当前用户是这样,也就是我lk这个用户。我仔细回忆了一下我昨天都干了什么,最后将问题定位到了Anaconda身上:莫不是你覆盖了系统自带的Python,软件版本不兼容然后就出问题了呢。昨天Anaconda除了安装了自己的文件,就只动了我系统的一样东西:.bashrc
打开.bashrc发现主要就是加了个PATH,但是它是把Anaconda放在最前面的。这样就会导致系统首先搜索到AnacondaPython

解决办法

home/lk/下的.bashrc给删了。
然后在/etc/profile里加上export PATH=$PATH:~/anaconda3/bin
注意了,一定要把$PATH放在前面。
重启系统就可以使用了。

结果

系统自带python2:

lk@k:/etc> python
Python 2.7.13 (default, Jan 03 2017, 17:41:54) [GCC] on linux2                                  
Type "help", "copyright", "credits" or "license" for more information.                          
>>>   

系统自带Python3:

lk@k:/etc> python3
Python 3.4.6 (default, Mar 22 2017, 12:26:13) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Anaconda-Python3:

lk@k:/etc> python3.6
Python 3.6.5 |Anaconda custom (64-bit)| (default, Mar 29 2018, 18:21:58) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

环境:

lk@k:~> conda info -a

     active environment : None
       user config file : /home/lk/.condarc
 populated config files : 
          conda version : 4.5.0
    conda-build version : 3.4.1
         python version : 3.6.4.final.0
       base environment : /home/lk/anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/linux-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /home/lk/anaconda3/pkgs
                          /home/lk/.conda/pkgs
       envs directories : /home/lk/anaconda3/envs
                          /home/lk/.conda/envs
               platform : linux-64
             user-agent : conda/4.5.0 requests/2.18.4 CPython/3.6.4 Linux/4.4.120-45-default opensuse/42.3 glibc/2.22
                UID:GID : 1000:100
             netrc file : None
           offline mode : False

# conda environments:
#
base                  *  /home/lk/anaconda3

sys.version: 3.6.4 |Anaconda custom (64-bit)| (defaul...
sys.prefix: /home/lk/anaconda3
sys.executable: /home/lk/anaconda3/bin/python
conda location: /home/lk/anaconda3/lib/python3.6/site-packages/conda
conda-build: /home/lk/anaconda3/bin/conda-build
conda-convert: /home/lk/anaconda3/bin/conda-convert
conda-develop: /home/lk/anaconda3/bin/conda-develop
conda-env: /home/lk/anaconda3/bin/conda-env
conda-index: /home/lk/anaconda3/bin/conda-index
conda-inspect: /home/lk/anaconda3/bin/conda-inspect
conda-metapackage: /home/lk/anaconda3/bin/conda-metapackage
conda-render: /home/lk/anaconda3/bin/conda-render
conda-server: /home/lk/anaconda3/bin/conda-server
conda-skeleton: /home/lk/anaconda3/bin/conda-skeleton
conda-verify: /home/lk/anaconda3/bin/conda-verify
user site dirs: 

ALSA_CONFIG_PATH: /etc/alsa-pulse.conf
CIO_TEST: set>
CONDA_ROOT: /home/lk/anaconda3
MANPATH: /usr/local/man:/usr/share/man
PATH: /home/lk/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/lk/anaconda3/bin
PYTHONSTARTUP: /etc/pythonstart
REQUESTS_CA_BUNDLE: set>
SSL_CERT_FILE: set>
XDG_SEAT_PATH: /org/freedesktop/DisplayManager/Seat0
XDG_SESSION_PATH: /org/freedesktop/DisplayManager/Session1
XNLSPATH: /usr/share/X11/nls

你可能感兴趣的:(Python,Linux)