Hazem Hagrass Hazem Hagrass - 3 months ago 59
Python Question

virtualenvwrapper: Command "python setup.py egg_info" failed with error code 1

When trying to install virtualenvwrapper on my mac os v10.11 using:


sudo pip install virtualenvwrapper


I got the following error message:



Command "python setup.py egg_info" failed with error code 1 in
/private/tmp/pip-build-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
from docutils.utils import Reporter
File "/usr/local/lib/python2.7/site-packages/docutils/utils/init.py",
line 20, in
import docutils.io
File "/usr/local/lib/python2.7/site-packages/docutils/io.py", line 18, in
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
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/

Answer

You can try the solution explained here

add these lines to your ~/.bash_profile: export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8