在Fedora27上安装Anaconda3后,DNF和YUM损坏

最后发布: 2018-02-14 02:29:50


问题

我正在Fedora 27上的python3中工作,并且试图通过pip3安装Theano软件包。 该软件包更容易通过anaconda3安装,因此我随后安装了anaconda。 之后,DNF和YUM开始在任何调用中返回以下内容:

Traceback (most recent call last):
File "/usr/bin/dnf", line 57, in <module>
from dnf.cli import main
File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in 
<module>
import dnf.base
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 26, in 
<module>
from dnf.comps import CompsQuery
File "/usr/lib/python3.6/site-packages/dnf/comps.py", line 29, in 
<module>
import dnf.util
File "/usr/lib/python3.6/site-packages/dnf/util.py", line 32, in 
<module>
import librepo

从我的搜索中,人们建议使用以下代码重新安装python3,该代码返回:

[ajwinters@localhost ~]$ sudo yum-deprecated reinstall python3
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.

File "/usr/libexec/urlgrabber-ext-down", line 28
  except OSError, e:
                  ^
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
                  ^
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
                  ^
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
                  ^
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
                  ^
SyntaxError: invalid syntax


Exiting on user cancel

DNF YUM和YUM-Preprecated目前不为我工作。

让我知道我可以提供哪些信息来帮助解决此问题。

我一直在通过终端做所有事情,所以我认为那是我弄糟的东西。 这是相关的历史记录:

  605  pip install pymc3
  606  pip install --user pymc3
  607  pip install --user pymc3 numdifftools statsmodels
  608  source env/bin/activate
  609  juptyer notebook
  610  jupyter notebook
  611  source env/bin/activate
  612  jupyter notebook
  613  python3
  614  python
  615  pip3 install pymc3 numdifftools statmodels
  616  pip3 install pymc3 numdifftools statsmodels
  617  pip3 install --user pymc3 numdifftools statsmodels
  618  pip3 install --user patsy theano
  619  pip3 install --user patsy theano matplotlib numpy scipy pandas
  620  conda install mingw libpython
  621  pip3 install --user theano
  622  pip3 install --user theano pymc3
  623  source activate/bin/env
  624  source env/bin/activate
  625  jupyter notebook
  626  conda
  627  python3
  628  python
  629  conda install theano
  630  pip3 install --usesr theano
  631  pip3 install --user theano
  632  nvidia-docker
  633  sudo nvidia-docker run -it kaixhin/cuda-theano:7.0
  634  sudo dnf install nvidia-docker
  635  sudo dnf install nvidia-docker2
  636  python3 -c 'import theano: print(theano.config)' | less
  637  python3 -c 'import theano; print(theano.config)' | less
  638  python3
  639  conda install mingw libpython3
  640  conda install mingw libpython
  641  pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git --install-option='--prefix=~/.local':
  642  pip3 install --upgrade --no-deps git+git://github.com/Theano/Theano.git --install-option='--prefix=~/.local':
  643  python3
  644  pip3 install --user theano
  645  python3
  646  cd /home/ajwinters/.local/lib/python3.6/site-packages/theano/
  647  ls
  648  conda install scipy numpy BLAS
  649  conda install scipy numpy 
  650  cd ..
  651  cd /
  652  python3
  653  conda install numpy scipy mkl <nose> <sphinx> <pydot-ng>
  654  conda install numpy scipy mkl
  655  conda install numpy scipy mkl /usr
  656  conda install /usr numpy scipy mkl 
  657  conda install numpy scipy mkl
  658  anaconda3
  659  sudo dnf install anaconda3
  660  conda3 install /usr numpy scipy mkl 
  661  conda list
  662  conda install scipy
  663  conda create -n py37 python=3.7 anaconda
  664  conda create -n py36 python=3.6 anaconda
  665  source activate py36
  666  python3
  667  conda install theano py36
  668  conda install theano py36_env
  669  conda install theano -n py36_env
  670  conda install theano -n py36
  671  python3
  672  conda install numpy scipy mkl
  673  Anaconda3-4.3.1-Linux-x86_64.sh
  674  cd /home/ajwinters/
  675  ls
  676  cd /
  677  cd /usr/
  678  ls
  679  cd -a
  680  ls -a
  681  sudo chown -R usr foldername
  682  sudo conda install numpy scipy mkl
  683  python3
  684  cd/
  685  cd /
  686  ls
  687  history | grep source
  688  source env//bin/activate
  689  source env/bin/activate
  690  ls
  691  cd 
  692  ls
  693  cd env/bin/activate
  694  cd env/
  695  ls
  696  cd bin/
  697  ls
  698  activate
  699  source activate
  700  exit
  701  pip3 intall --upgradepip install --upgrade --no-deps git+git://github.com/Theano/Theano.git --user  # Need Theano 0.8 or more recent
  702  pip3 install --upgrade --no-deps git+git://github.com/Theano/Theano.git --user  # Need Theano 0.8 or more recent
  703  source env/bin/activate
  704  jupyter notebook
  705  source /env/bin/activate
  706  source env/bin/activate
  707  jupyter
  708  history | grep notebook
  709  jupyter notebook
  710  exit
  711  pip3 install jupyter
  712  source env/bin/activate
  713  jupyter notebook
  714  pip3 install jupyter
  715  jupyter notebook
  716  exit
  717  pip3 install jupyter
  718  pip3 install --user jupyter
  719  jupyter notebook
  720  conda update
  721  conda update --all
  722  sudo conda update --all
  723  jupyter notebook
  724  pip3 update 
  725  pip3 --update 
  726  pip3 --updateall
  727  jupyter notebook
  728  source activate py36
  729  pip install jupyter
  730  jupyter notebook
  731  printenv
  732  printenv | grep py36
  733  printenv
  734  cd
  735  ls
  736  sudo dnf update
  737  update
  738  dnf update
  739  dnf upgrade
  740  dnf search steam
  741  dnf search
  742  dnf
  743  dnf upgrade
  744  pip3 update
  745  pip3 upgrade
  746  pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U
  747  cd /usr/bin/dnf
  748  ls
  749  edit /usr/bin/dnf
  750  cd /usr/bin/
  751  ls
  752  ls | grep python
  753  python3.6
  754  history | grep py36
  755  source deactivate py36
  756  steam
  757  python3
  758  dnf install

758行是问题首先到达的地方。

python-3.x pip anaconda yum dnf