NameError:未定义名称“sys_platform”

时间:2016-08-08 12:26:38

标签: python setuptools

我查看了其他一些帖子并尝试--upgrade升级setuptools,但没有帮助。

输出如下,通过我使用OSX的方式,

我的python版本是Python 2.7.6 -- 64-bit

   ~$ pip install urlopen

Collecting urlopen
  Using cached urlopen-1.0.0.zip
    .....
        return eval(compiled_marker, environment)

      File "<environment marker>", line 1, in <module>

    NameError: name 'sys_platform' is not defined

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /var/folders/tb/gh49g76s63l3rk1p63lfbs800000gn/T/pip-build-navlZP/urlopen

更新:

我首先尝试卸载'distribute',但输出意味着失败

~$ pip uninstall distribute
You are using pip version 6.0.6, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Not uninstalling distribute at /Applications/Canopy.app/appdata/canopy-1.5.2.2785.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages, outside environment /Users/lilisun/Library/Enthought/Canopy_64bit/User

更新:2016-08-19

使用enpkg setuptoolsenpkg pip解决了此问题。我GUESS问题可能是由某事造成的。与Canopy的虚拟环境有关。

0 个答案:

没有答案