{"id":1110,"hash":"4d92fe57292740a278689c2ba433f35117ff130f6ba4f701b00629274c49cf75","pattern":"Getting error while trying to run this command &quot; pipenv install requests &quot; in mac OS","full_message":"I am facing the following error:\n\nWarning: the environment variable LANG is not set!\nWe recommend setting this in ~/.profile (or equivalent) for proper expected behavior.\nCreating a virtualenv for this project…\nUsing /usr/local/opt/python/bin/python3.6 (3.6.4) to create virtualenv…\n⠋Traceback (most recent call last):\n  File \"/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py\", line 193, in _run_module_as_main\n    \"__main__\", mod_spec)\n  File \"/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/pew/__main__.py\", line 8, in <module>\n    import pew\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/__init__.py\", line 1, in <module>\n    from . import pew\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/pew.py\", line 41, in <module>\n    from pew._utils import (check_call, invoke, expandpath, own, env_bin_dir,\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/_utils.py\", line 22, in <module>\n    encoding = locale.getlocale()[1] or 'ascii'\n  File \"/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py\", line 581, in getlocale\n    return _parse_localename(localename)\n  File \"/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py\", line 490, in _parse_localename\n    raise ValueError('unknown locale: %s' % localename)\nValueError: unknown locale: UTF-8\n\nVirtualenv location:\n\nCreating a Pipfile for this project…\nTraceback (most recent call last):\n  File \"/usr/local/bin/pipenv\", line 11, in <module>\n    sys.exit(cli())\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 722, in __call__\n    return self.main(*args, **kwargs)\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 697, in main\n    rv = self.invoke(ctx)\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 895, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 535, in invoke\n    return callback(*args, **kwargs)\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/cli.py\", line 366, in install\n    selective_upgrade=selective_upgrade,\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/core.py\", line 1761, in do_install\n    skip_requirements=skip_requirements,\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/core.py\", line 636, in ensure_project\n    ensure_pipfile(validate=validate, skip_requirements=skip_requirements)\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/core.py\", line 289, in ensure_pipfile\n    project.create_pipfile(python=python)\n  File \"/usr/local/lib/python3.6/site-packages/pipenv/project.py\", line 518, in create_pipfile\n    'python_version': python_version(required_python)[: len('2.7')]\nTypeError: 'NoneType' object is not subscriptable\n\nI tried setting the LANG in ~/.profile and ~/.bash_profile. Both didn't work.","ecosystem":"pypi","package_name":"python-3.x","package_version":null,"solution":"What worked for me on Mac OS X Sierra is adding the following into my ~/.bash_profile file:\n\nexport LANG=\"en_US.UTF-8\"\nexport LC_ALL=\"en_US.UTF-8\"\nexport LC_CTYPE=\"en_US.UTF-8\"\n\nThen I reloaded the bash profile with: source ~/.bash_profile\n\nFor those who use zsh shell, you must add those lines to your ~/.zshrc\n\nexport LANG=\"en_US.UTF-8\"\nexport LC_ALL=\"en_US.UTF-8\"\nexport LC_CTYPE=\"en_US.UTF-8\"\n\nThen I reload the bash profile with: source ~/.zshrc","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/49436922/getting-error-while-trying-to-run-this-command-pipenv-install-requests-in-ma","votes":39,"created_at":"2026-04-19T04:52:22.553105+00:00","updated_at":"2026-04-19T04:52:22.553105+00:00"}