可能是因为我自己手动下载了Python3.6后,导致Pip3软连接紊乱,后来pip3坏了不是很好用,重装之后也没使得conda恢复。 我当时的情况是终端输入python,会显示:
Python 3.7.4 (default, Aug 13 2019, 20:35:49)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
但是输入conda的任何指令例如:conda list、conda --version等都会显示:
Traceback (most recent call last):
File "/home/k/anaconda3/bin/conda", line 13, in <module>
sys.exit(main())
File "/home/k/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 149, in main
from ..exceptions import conda_exception_handler
File "/home/k/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 25, in <module>
from .common.io import dashlist, timeout
File "/home/k/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 7, in <module>
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, Executor, Future, _base, as_completed
File "/usr/lib/python2.7/dist-packages/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "/usr/lib/python2.7/dist-packages/concurrent/futures/_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
受教于此文,我在终端输入:
unset PYTHONPATH
将python的路径都消掉了,后恢复原状
|