virtualenvwrapper:命令" python setup.py egg_info"失败,错误代码为1

时间:2016-08-21 16:32:00

标签: python django web virtualenv virtualenvwrapper

尝试使用以下方法在我的mac os v10.11上安装 virtualenvwrapper

  

sudo pip install virtualenvwrapper

我收到以下错误消息:

  

命令" python setup.py egg_info"失败,错误代码为1   /私人/ TMP / PIP-积聚ktzs4x / virtualenvwrapper /

Here are my logs: Collecting virtualenvwrapper   Downloading virtualenvwrapper-4.7.2.tar.gz (90kB)
    100% |████████████████████████████████| 92kB 243kB/s 
    Complete output from command python setup.py egg_info:
    ERROR:root:Error parsing
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/pbr/core.py", line 111, in pbr
        attrs = util.cfg_to_args(path, dist.script_args)
      File "/usr/local/lib/python2.7/site-packages/pbr/util.py", line 264, in cfg_to_args
        wrap_commands(kwargs)
      File "/usr/local/lib/python2.7/site-packages/pbr/util.py", line 576, in wrap_commands
        for cmd, _ in dist.get_command_list():
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 530, in get_command_list
        return _Distribution.get_command_list(self)
      File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 772, in get_command_list
        klass = self.get_command_class(cmd)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 514, in get_command_class
        return _Distribution.get_command_class(self, command)
      File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 815, in get_command_class
        __import__ (module_name)
      File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/check.py", line 13, in <module>
        from docutils.utils import Reporter
      File "/usr/local/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
        import docutils.io
      File "/usr/local/lib/python2.7/site-packages/docutils/io.py", line 18, in <module>
        from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
      File "/usr/local/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
        locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
      File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
        return _parse_localename(localename)
      File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
        raise ValueError, 'unknown locale: %s' % localename
    ValueError: unknown locale: UTF-8
    error in setup command: Error parsing /private/tmp/pip-build-ktzs4x/virtualenvwrapper/setup.cfg: ValueError: unknown locale: UTF-8

    ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-ktzs4x/virtualenvwrapper/

1 个答案:

答案 0 :(得分:4)

您可以尝试解释here

的解决方案
  

将这些行添加到〜/ .bash_profile:    export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8