git commit 时,报错
[INFO] Installing environment for https://github.com/pre-commit...
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: Command: ('/usr/bin/python', '-m', 'virtualenv', '/data/home/wanghuimin/.cache/pre-commit/repooNH01N/py_env-python2.7', '-p', 'python2.7')
Return code: 1
Expected return code: 0
Output:
New python executable in /data/home/wanghuimin/.cache/pre-commit/repooNH01N/py_env-python2.7/bin/python2.7
Also creating executable in /data/home/wanghuimin/.cache/pre-commit/repooNH01N/py_env-python2.7/bin/python
Installing setuptools, pip, wheel...
Complete output from command /data/home/wanghuimi...hon2.7/bin/python2.7 - setuptools pip wheel:
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 21, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/requests/__init__.py", line 62, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/requests/packages/__init__.py", line 29, in <module>
ImportError: No module named urllib3
----------------------------------------
...Installing setuptools, pip, wheel...done.
Running virtualenv with interpreter /data/home/wanghuimin/miniconda2/envs/xcf/bin/python2.7
Errors:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2328, in <module>
main()
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 713, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 945, in create_environment
download=download,
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 901, 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 797, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /data/home/wanghuimi...hon2.7/bin/python2.7 - setuptools pip wheel failed with error code 1
Check the log at /data/home/wanghuimin/.cache/pre-commit/pre-commit.log
有人知道怎么解决吗
看情况是没有安装urllib3,可以先使用pip安装了urllib3。