【发布时间】:2015-12-08 00:19:27
【问题描述】:
我遇到了一个我无法解决的错误,尽管其他人报告了同样的错误。
我正在远程连接到 Linux 机器。我已经安装了最新版本的 anaconda:
$ bash Anaconda2-2.4.0-Linux-x86_64.sh
// A lot of python libraries get installed
installing: _cache-0.0-py27_x0 ...
Python 2.7.10 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
我更新了对应的路径,好像可以了:
$ python
Python 2.7.10 |Anaconda 2.4.0 (64-bit)| (default, Oct 19 2015, 18:04:42)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
太好了,所以现在我想使用 Anaconda 预装的conda。看起来 Anaconda 给了我 3.18.3:
$ conda --version
conda 3.18.3
按照test drive instructions,我更新了conda:
$ conda update conda
Fetching package metadata: An unexpected error has occurred, please consider sending the
following traceback to the conda GitHub issue tracker at:
https://github.com/conda/conda/issues
Include the output of the command 'conda info' in your report.
Traceback (most recent call last):
File "/code/anaconda2-4-0/bin/conda", line 5, in <module>
sys.exit(main())
File "/code/anaconda2-4-0/lib/python2.7/site-packages/conda/cli/main.py", line 195, in main
args_func(args, p)
File "/code/anaconda2-4-0/lib/python2.7/site-packages/conda/cli/main.py", line 202, in args_func
args.func(args, p)
File "/code/anaconda2-4-0/lib/python2.7/site-packages/conda/cli/main_update.py", line 48, in execute
install.install(args, parser, 'update')
File "/code/anaconda2-4-0/lib/python2.7/site-packages/conda/cli/install.py", line 239, in install
offline=args.offline)
File "/code/anaconda2-4-0/lib/python2.7/site-packages/conda/cli/common.py", line 598, in get_index_trap
return get_index(*args, **kwargs)
File "/code/anaconda2-4-0/lib/python2.7/site-packages/conda/api.py", line 42, in get_index
unknown=unknown)
File "/code/anaconda2-4-0/lib/python2.7/site-packages/conda/utils.py", line 119, in __call__
value = self.func(*args, **kw)
File "/code/anaconda2-4-0/lib/python2.7/site-packages/conda/fetch.py", line 237, in fetch_index
session = CondaSession()
File "/code/anaconda2-4-0/lib/python2.7/site-packages/conda/connection.py", line 61, in __init__
super(CondaSession, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 272, in __init__
self.headers = default_headers()
File "/usr/lib/python2.7/dist-packages/requests/utils.py", line 555, in default_headers
'User-Agent': default_user_agent(),
File "/usr/lib/python2.7/dist-packages/requests/utils.py", line 524, in default_user_agent
_implementation = platform.python_implementation()
File "/usr/lib/python2.7/platform.py", line 1521, in python_implementation
return _sys_version()[0]
File "/usr/lib/python2.7/platform.py", line 1486, in _sys_version
repr(sys_version))
ValueError: failed to parse CPython sys.version: '2.7.10 |Anaconda 2.4.0 (64-bit)| (default, Oct 19 2015, 18:04:42) \n[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]'
很遗憾,我不知道如何避免这个错误。
我发现了一些其他 StackOverflow 帖子。 This one 建议从头开始重新安装 python 和 pycharm(但我刚刚安装了 Anaconda,我没有使用 pycharm)。 Another suggests 重新安装机盖,但我没有在这里使用它。最后,a third suggests 这实际上是一个错误,并提出了修复建议。不幸的是,重命名 sys.version 无法解决该错误。这甚至不是我的电脑,所以我不想深入研究代码并冒险搞砸。
我会很感激一些想法或建议。
【问题讨论】:
标签: python anaconda cpython conda