Getting error while trying to run this command “ pipenv install requests ” in mac OS
我面临以下错误:
Warning: the environment variable LANG is not set!
We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
Creating a virtualenv for this project…
Using /usr/local/opt/python/bin/python3.6 (3.6.4) to create virtualenv…
?Traceback (most recent call last):
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
"main", mod_spec)
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
exec(code, run_globals)
File"/usr/local/lib/python3.6/site-packages/pipenv/pew/main.py", line 8, in
import pew
File"/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/init.py", line 1, in
from . import pew
File"/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/pew.py", line 41, in
from pew._utils import (check_call, invoke, expandpath, own, env_bin_dir,
File"/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/_utils.py", line 22, in
encoding = locale.getlocale()[1] or 'ascii'
File"/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py", line 581, in getlocale
return _parse_localename(localename)
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
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8Virtualenv location:
Creating a Pipfile for this project…
Traceback (most recent call last):
File"/usr/local/bin/pipenv", line 11, in
sys.exit(cli())
File"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File"/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 366, in install
selective_upgrade=selective_upgrade,
File"/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 1761, in do_install
skip_requirements=skip_requirements,
File"/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 636, in ensure_project
ensure_pipfile(validate=validate, skip_requirements=skip_requirements)
File"/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 289, in ensure_pipfile
project.create_pipfile(python=python)
File"/usr/local/lib/python3.6/site-packages/pipenv/project.py", line 518, in create_pipfile
'python_version': python_version(required_python)[: len('2.7')]
TypeError: 'NoneType' object is not subscriptable
号
我尝试在~/.profile和~/.bash-u配置文件中设置
我在Mac OS X Sierra上的工作是将以下内容添加到我的
1 2 3 | export LANG="en_US.UTF-8" export LC_ALL="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8" |
然后我用:
对于使用zsh的用户,必须将这些行添加到~/.zshrc中。
1 2 3 | export LANG="en_US.UTF-8" export LC_ALL="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8" |
然后我用:
对于使用zsh的用户,必须将这些行添加到~/.zshrc中。
1 2 3 | export LANG="en_US.UTF-8" export LC_ALL="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8" |