Skip to content

Instantly share code, notes, and snippets.

@anddam
Last active December 11, 2016 08:23
Show Gist options
  • Save anddam/e2f4e4dc28d20a0cd8decd6348eb6d39 to your computer and use it in GitHub Desktop.
Save anddam/e2f4e4dc28d20a0cd8decd6348eb6d39 to your computer and use it in GitHub Desktop.
Xonsh locale error while creating new environment with vox, manually running the command seems to work with correct LANG set but not vox itself.
anddam@bibook ~ bibook $ vox ls
No environments available. Create one with "vox new".
anddam@bibook ~ bibook $ vox new test
Creating environment...
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 9607, in wrapped_simple_command
r = f(args, i)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xontrib/vox.py", line 154, in handle
return vox(args, stdin=stdin)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xontrib/vox.py", line 86, in __call__
getattr(self, 'cmd_'+cmd)(args, stdin)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xontrib/vox.py", line 92, in cmd_new
self.vox.create(args.name)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xontrib/voxapi.py", line 139, in create
with_pip=with_pip)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/venv/__init__.py", line 371, in create
builder.create(env_dir)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/venv/__init__.py", line 83, in create
self._setup_pip(context)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/venv/__init__.py", line 255, in _setup_pip
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/Users/anddam/.virtualenvs/test/bin/python3.5', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
anddam@bibook ~ bibook [1]$ /Users/anddam/.virtualenvs/test/bin/python3.5 -Im ensurepip --upgrade --default-pip
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ensurepip/__main__.py", line 4, in <module>
ensurepip._main()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ensurepip/__init__.py", line 209, in _main
default_pip=args.default_pip,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ensurepip/__init__.py", line 116, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ensurepip/__init__.py", line 41, in _run_pip
pip.main(args)
File "/var/folders/2k/_wbslyt51zqdr0m54pj707l80000gn/T/tmp2l37n4hy/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 215, in main
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/locale.py", line 594, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
anddam@bibook ~ bibook [1]$
anddam@bibook ~ bibook [1]$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
anddam@bibook ~ bibook $ $LANG = 'en_US.UTF-8'
anddam@bibook ~ bibook $ /Users/anddam/.virtualenvs/test/bin/python3.5 -Im ensurepip --upgrade --default-pip
Ignoring indexes: https://pypi.python.org/simple
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-8.1.1 setuptools-20.10.1
anddam@bibook ~ bibook $ vox activate test
Activated "test".
(test) anddam@bibook ~ bibook $ vox deactivate
Deactivated "test".
anddam@bibook ~ bibook $ vox remove test
Environment "test" removed.
anddam@bibook ~ bibook $ vox new test
Creating environment...
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 9607, in wrapped_simple_command
r = f(args, i)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xontrib/vox.py", line 154, in handle
return vox(args, stdin=stdin)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xontrib/vox.py", line 86, in __call__
getattr(self, 'cmd_'+cmd)(args, stdin)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xontrib/vox.py", line 92, in cmd_new
self.vox.create(args.name)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xontrib/voxapi.py", line 139, in create
with_pip=with_pip)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/venv/__init__.py", line 371, in create
builder.create(env_dir)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/venv/__init__.py", line 83, in create
self._setup_pip(context)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/venv/__init__.py", line 255, in _setup_pip
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/Users/anddam/.virtualenvs/test/bin/python3.5', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
anddam@bibook ~ bibook [1]$
+------------------+-----------------+
| xonsh | 0.4.7 |
| Git SHA | None |
| Python | 3.5.2 |
| PLY | 3.8 |
| have readline | True |
| prompt toolkit | 1.0.8 |
| shell type | prompt_toolkit |
| pygments | 2.1.3 |
| on posix | True |
| on linux | False |
| on darwin | True |
| on windows | False |
| on cygwin | False |
| is superuser | False |
| default encoding | utf-8 |
| xonsh encoding | utf-8 |
| encoding errors | surrogateescape |
+------------------+-----------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment