{"id":242,"hash":"4b273b2a9cf11ca5f7e206c6b7a5cde4939f2ea419b988c8495b9abd46f48530","pattern":"pip install - locale.Error: unsupported locale setting","full_message":"Full stacktrace:  \n\n➜  ~ pip install virtualenv\nTraceback (most recent call last):\n  File \"/usr/bin/pip\", line 11, in <module>\n    sys.exit(main())\n  File \"/usr/lib/python3.4/site-packages/pip/__init__.py\", line 215, in main\n    locale.setlocale(locale.LC_ALL, '')\n  File \"/usr/lib64/python3.4/locale.py\", line 592, in setlocale\n    return _setlocale(category, locale)\nlocale.Error: unsupported locale setting\n\nOn the same server, I successfully ran pip install virtualenv with python 2.7.x.  \n\nNow, I've just installed python3.4 using curl https://bootstrap.pypa.io/get-pip.py | python3.4.  \n\n➜  ~ pip --version\npip 8.1.1 from /usr/lib/python3.4/site-packages (python 3.4)\n\npip uninstall virtualenv throws the same error too","ecosystem":"pypi","package_name":"python-3.x","package_version":null,"solution":"The root cause is: your environment variable LC_ALL is missing or invalid somehow  \n\nShort answer- \n\njust run the following command:\n\n$ export LC_ALL=C\n\nIf you keep getting the error in new terminal windows, add it at the bottom of your .bashrc file.\n\nLong answer-\n\nHere is my locale settings:\n\n$ locale\nLANG=en_US.UTF-8\nLANGUAGE=\nLC_CTYPE=\"C\"\nLC_NUMERIC=\"C\"\nLC_TIME=\"C\"\nLC_COLLATE=\"C\"\nLC_MONETARY=\"C\"\nLC_MESSAGES=\"C\"\nLC_PAPER=\"C\"\nLC_NAME=\"C\"\nLC_ADDRESS=\"C\"\nLC_TELEPHONE=\"C\"\nLC_MEASUREMENT=\"C\"\nLC_IDENTIFICATION=\"C\"\nLC_ALL=C\n\nPython2.7\n\n    $ uname -a\n    Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u6 (2015-11-09) x86_64 GNU/Linux\n    $ python --version\n    Python 2.7.9\n    $ pip --version\n    pip 8.1.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)\n    $ unset LC_ALL\n    $ pip install virtualenv\n    Traceback (most recent call last):\n      File \"/usr/local/bin/pip\", line 11, in <module>\n        sys.exit(main())\n      File \"/usr/local/lib/python2.7/dist-packages/pip/__init__.py\", line 215, in main\n        locale.setlocale(locale.LC_ALL, '')\n      File \"/usr/lib/python2.7/locale.py\", line 579, in setlocale\n        return _setlocale(category, locale)\n    locale.Error: unsupported locale setting\n    $ export LC_ALL=C\n    $ pip install virtualenv\n    Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/dist-packages","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/36394101/pip-install-locale-error-unsupported-locale-setting","votes":257,"created_at":"2026-04-19T04:41:35.782715+00:00","updated_at":"2026-04-19T04:51:47.831673+00:00"}