1

I'm creating a new virtual environment on RaspberryPi. Every necessary package is installed but when I want to create a virtual environment it throws an error like this.

$ virtualenv venv --system-site-packages
New python executable in /home/pi/venv/bin/python
Installing setuptools, pip, wheel...
  Complete output from command /home/pi/venv/bin/python - setuptools pip wheel:
  Traceback (most recent call last):
  File "<stdin>", line 23, in <module>
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 215, in main
  File "/home/pi/venv/lib/python2.7/locale.py", line 579, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 708, in main
    symlink=options.symlink)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 941, in create_environment
    download=download,
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 897, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 792, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/pi/venv/bin/python - setuptools pip wheel failed with error code 1

This virtual environment is still created but when I navigate to /venv/bin, the only files are

~/venv/bin $ ls
python  python2  python2.7

so that

$ source bin/activate
-bash: bin/activate: No such file or directory

I'm very confused please help >_< Thanks!

ClaireL
  • 443
  • 6
  • 10

1 Answers1

1

I have the exact same problem.

I solved it doing this

sudo apt-get install language-pack-id
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales

I tried many things but only this solved it, but again i'm new at this so i'm not sure what i'm doing. hopefully this was what solved it and not this + a combination of the 300 things i tried before.

got the answer from here Python locale error: unsupported locale setting

Community
  • 1
  • 1
tomasdms
  • 11
  • 1
  • 4