使用pip安装模块,“无法解析CPython sys.version" [英] Installing modules with pip, "failed to parse CPython sys.version"

查看:595
本文介绍了使用pip安装模块,“无法解析CPython sys.version"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的第一篇文章,因此,如果我遗漏了任何关键信息或格式不正确,请告诉我.

this is my first post, so if I'm leaving out any key information or my formatting is off, please let me know.

我正在PC上重新安装python,自从开始使用Enthought Canopy以来就没有使用过它.此后,我已经卸载了机盖,最近又重新安装了python 2.7.10.我正在尝试使用cmd中的以下命令安装numpy,scipy和一些类似的基于科学的软件包:

I'm reinstalling python on my PC, and I haven't used it since I was getting started in Enthought Canopy. I have since uninstalled canopy, and recently reinstalled python 2.7.10. I'm trying to install numpy, scipy, and a handful of similar science based packages, using the following in cmd:

pip install numpy

我得到以下回溯:

Traceback (most recent call last):
File "c:\users\chris\appdata\local\enthought\canopy\user\scripts\pip-script.py", line 8, in <module>
from pip import main
File "C:\Python27\lib\site-packages\pip\__init__.py", line 17, in <module>
from pip.commands import get_summaries, get_similar_commands
File "C:\Python27\lib\site-packages\pip\commands\__init__.py", line 6, in <module>
from pip.commands.completion import CompletionCommand
File "C:\Python27\lib\site-packages\pip\commands\completion.py", line 4, in <module>
from pip.basecommand import Command
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 20, in <module>
from pip.req import InstallRequirement, parse_requirements
File "C:\Python27\lib\site-packages\pip\req\__init__.py", line 3, in <module>
from .req_install import InstallRequirement
File "C:\Python27\lib\site-packages\pip\req\req_install.py", line 17, in <module>
from pip._vendor.distlib.markers import interpret as markers_interpret
File "C:\Python27\lib\site-packages\pip\_vendor\__init__.py", line 72, in load_module
__import__(name)
File "C:\Python27\lib\site-packages\pip\_vendor\distlib\markers.py", line 20, in <module>
class Evaluator(object):
File "C:\Python27\lib\site-packages\pip\_vendor\distlib\markers.py", line 48, in Evaluator
'platform_python_implementation': python_implementation(),
File "C:\Python27\Lib\platform.py", line 1498, in python_implementation
return _sys_version()[0]
File "C:\Python27\Lib\platform.py", line 1463, in _sys_version
repr(sys_version))
ValueError: failed to parse CPython sys.version: '2.7.6 |CUSTOM| (default, Jun  4 2014, 16:30:34) [MSC v.1500 64 bit (AMD64)]'

我不确定为什么它告诉我我的版本是2.7.6,或者为什么它说我在AMD64系统上运行(我在x64设备上).知道会发生什么吗?

I'm not sure why it's telling me my version is 2.7.6, or why it says I'm running on an AMD64 system (I'm on an x64 device). Any idea what might be going on?

我看到了类似的帖子问题,但是建议的解决方案(手动设置sys.version字符串)无济于事,每当我尝试安装时,它都会将自身重置为上面显示的状态.

I saw a post of a similar problem, but the suggested resolution (setting the sys.version string manually) didn't help, whenever I attempted to install, it reset itself to the one displayed above.

再次感谢您的帮助.干杯!

Again, any help is appreciated. Cheers!

推荐答案

我浏览了计算机,找到了Canopy的旧版本.一旦删除了先前安装的python,问题就解决了.

I went through my computer and located the old install of Canopy. Once I removed the previous install of python, the issue was resolved.

这篇关于使用pip安装模块,“无法解析CPython sys.version"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆