【问题标题】:conda ValueError: failed to parse Cpython sys.versionconda ValueError:无法解析 Cpython sys.version
【发布时间】:2017-03-07 14:22:35
【问题描述】:

我正在尝试在 Windows 7 64 位系统上的现有 Python 环境(32 位)上安装 Anaconda(32 位)。我能够让 Anaconda python 环境运行,但导航器不会响应并且 conda 命令失败并出现错误

ValueError: 解析 CPython sys.version 失败

我已删除 C:\Python27; C:\Python27\脚本;来自 PATH 变量,但我一定遗漏了什么!

C:\Users\gaurav>python
Python 2.7.13 |Anaconda 4.3.0 (32-bit)| (default, Dec 19 2016, 13:36:02) [MSC v.
1500 32 bit (Intel)] on win32
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
>>> quit()

C:\Users\gaurav>conda
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues

Traceback (most recent call last):
  File "C:\Users\gaurav\Anaconda2\Scripts\conda-script.py", line 5, in <module>
    sys.exit(conda.cli.main())
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\cli\main.py", line 167
, in main
    return conda_exception_handler(_main, *args)
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\exceptions.py", line 6
33, in conda_exception_handler
    print_unexpected_error_message(e)
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\exceptions.py", line 5
60, in print_unexpected_error_message
    info_stdout, info_stderr = get_info()
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\exceptions.py", line 5
30, in get_info
    args.func(args, p)
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\cli\main_info.py", lin
e 142, in execute
    from conda.api import get_index
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\api.py", line 1, in <m
odule>
    from .core.index import get_index
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\core\index.py", line 2
2, in <module>
    from .package_cache import PackageCache
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\core\package_cache.py"
, line 9, in <module>
    from .path_actions import CacheUrlAction, ExtractPackageAction
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\core\path_actions.py",
 line 32, in <module>
    from ..gateways.download import download
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\gateways\download.py",
 line 15, in <module>
    from ..connection import CondaSession
  File "C:\Users\gaurav\Anaconda2\lib\site-packages\conda\connection.py", line 5
5, in <module>
    python=platform.python_implementation(),
  File "C:\Python27\Lib\platform.py", line 1460, in python_implementation
    return _sys_version()[0]
  File "C:\Python27\Lib\platform.py", line 1422, in _sys_version
    repr(sys_version))
ValueError: failed to parse CPython sys.version: '2.7.13 |Anaconda 4.3.0 (32-bit
)| (default, Dec 19 2016, 13:36:02) [MSC v.1500 32 bit (Intel)]'

C:\Users\gaurav>

【问题讨论】:

    标签: python anaconda


    【解决方案1】:

    我只是更新了系统环境变量 PATH,并没有触及 PythonPath,它被设置为 C:\Python27。这就是该 ValueError 的原因。我找到了我的解决方案in this stackoverflow answer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-21
      • 1970-01-01
      • 2022-08-08
      • 2020-11-04
      • 1970-01-01
      • 2015-06-17
      • 2016-02-03
      相关资源
      最近更新 更多