Bha*_*ddy 7 python installation python-3.x pipenv
我面临以下错误:
警告:未设置环境变量LANG!我们建议在〜/ .profile(或等效的)中设置它以获得正确的预期行为.为这个项目创建virtualenv ...使用/usr/local/opt/python/bin/python3.6(3.6.4)创建virtualenv ...⠋回溯(最近一次调用最后一次):文件"/ usr/local/Cellar/python /3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py",第193行,在_run_module_as_main" main ",mod_spec)文件"/usr/local/Cellar/python/3.6. 4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py",第85行,在_run_code exec(代码,run_globals)文件"/usr/local/lib/python3.6/site-packages/pipenv /座位/ 主 py"为第8行,在进口座位文件"/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/ INIT py"为,第1行,从.从pew._utils import导入pew文件"/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/pew.py",第41行,输入(check_call,invoke,expandpath,own,env_bin_dir,文件"/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/_utils.py",第22行,编码= locale.getlocale()[1]或"ascii"文件"/ usr /local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py",第581行,在getlocale中返回_parse_localename(localename)文件"/ usr/local/Cellar /python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py",第490行,在_parse_localename中引发ValueError('未知语言环境:%s'%localename)ValueError:未知语言环境:UTF-8
Virtualenv位置:为这个项目创建一个Pipfile ... Traceback(最近一次调用最后一次):文件"/ usr/local/bin/pipenv",第11行,在sys.exit(cli())文件"/ usr/local/lib /python3.6/site-packages/pipenv/vendor/click/core.py",第722行,在调用 返回self.main(*args,**kwargs)文件"/usr/local/lib/python3.6/ site-packages/pipenv/vendor/click/core.py",第697行,在主rv = self.invoke(ctx)文件"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click /core.py",第1066行,在调用return _process_result(sub_ctx.command.invoke(sub_ctx))文件"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py" ,第895行,在调用return ctx.invoke(self.callback,**ctx.params)文件"/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py",行535,在调用返回回调(*args,**kwargs)文件"/usr/local/lib/python3.6/site-packages/pipenv/cli.py",第366行,安装selective_upgrade = selective_upgrade,文件"/ usr/local/lib/python3.6/site-packages/pipenv/core.py",li ne 1761,在do_install中skip_requirements = skip_requirements,文件"/usr/local/lib/python3.6/site-packages/pipenv/core.py",第636行,在ensure_project中,ensure_pipfile(validate = validate,skip_requirements = skip_requirements)文件" /usr/local/lib/python3.6/site-packages/pipenv/core.py",第289行,在ensure_pipfile project.create_pipfile(python = python)文件"/usr/local/lib/python3.6/site- packages/pipenv/project.py",第518行,在create_pipfile'python_version'中:python_version(required_python)[:len('2.7')] TypeError:'NoneType'对象不可订阅
我尝试LANG在〜/ .profile和〜/ .bash_profile中设置.两者都没有奏效.
geo*_*sic 16
在Mac OS X Sierra上对我有用的是在我的~/bash_profile文件中添加以下内容:
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
Run Code Online (Sandbox Code Playgroud)
然后我重新加载了bash配置文件: source ~/.bash_profile
对于那些使用zsh的人,你必须将这些行添加到〜/ .zshrc中
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
Run Code Online (Sandbox Code Playgroud)
然后我重新加载bash配置文件: source ~/.zshrc
小智 10
对于使用 zsh 的用户,您必须将这些行添加到 ~/.zshrc
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1406 次 |
| 最近记录: |