Skip to content

On a Windows system, in either win7 or win2012R2, performing a pre-commit reports an error #1398

@xiaohuazi123

Description

@xiaohuazi123

All:
It looks like the pre-commit is using virtualenv

I used pre-commit on a Python project.

Is there any way to solve this problem?

The following log is excerpted from pre-committee.log
Log

An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\Administrator\\.cache\\pre-commit\\repop9_0qne0\\py_env-default\\Scripts\\pip.EXE', 'install', '.')
return code: 1
expected return code: 0
stdout:
    Looking in indexes: http://pypi.douban.com/simple
    Processing c:\users\administrator\.cache\pre-commit\repop9_0qne0
    Collecting six
      Downloading http://pypi.doubanio.com/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl (10 kB)
    Collecting pip-tools==3.6.1
      Downloading http://pypi.doubanio.com/packages/06/96/89872db07ae70770fba97205b0737c17ef013d0d1c790899c16bb8bac419/pip_tools-3.6.1-py2.py3-none-any.whl (35 kB)
    Collecting pip==19.1
      Downloading http://pypi.doubanio.com/packages/f9/fb/863012b13912709c13cf5cfdbfb304fa6c727659d6290438e1a88df9d848/pip-19.1-py2.py3-none-any.whl (1.4 MB)
    Collecting click>=6
      Downloading http://pypi.doubanio.com/packages/dd/c0/4d8f43a9b16e289f36478422031b8a63b54b6ac3b1ba605d602f10dd54d6/click-7.1.1-py2.py3-none-any.whl (82 kB)
    Building wheels for collected packages: pip-tools-compile
      Building wheel for pip-tools-compile (setup.py): started
      Building wheel for pip-tools-compile (setup.py): finished with status 'done'
      Created wheel for pip-tools-compile: filename=pip_tools_compile-1.0-py3-none-any.whl size=17905 sha256=30321f831b5ac147be919304dee138139d055f2bdb52a5511317bc718b29b76d
      Stored in directory: C:\Users\ADMINI~1\AppData\Local\Temp\pip-ephem-wheel-cache-b67alovp\wheels\f1\34\3c\bed42474e4aeb415aa0bfd1e28124cde97604fa12005eed65b
    Successfully built pip-tools-compile
    Installing collected packages: six, click, pip-tools, pip, pip-tools-compile
      Attempting uninstall: pip
        Found existing installation: pip 20.0.2
        Uninstalling pip-20.0.2:
          Successfully uninstalled pip-20.0.2
    
stderr:
    ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-uninstall-8wsztgaa\\pip.exe'
    Consider using the `--user` option or check the permissions.
    
    
Traceback (most recent call last):
  File "c:\program files\python37\lib\site-packages\pre_commit\error_handler.py", line 56, in error_handler
    yield
  File "c:\program files\python37\lib\site-packages\pre_commit\main.py", line 372, in main
    args=args.rest[1:],
  File "c:\program files\python37\lib\site-packages\pre_commit\commands\hook_impl.py", line 187, in hook_impl
    return retv | run(config, store, ns)
  File "c:\program files\python37\lib\site-packages\pre_commit\commands\run.py", line 355, in run
    install_hook_envs(hooks, store)
  File "c:\program files\python37\lib\site-packages\pre_commit\repository.py", line 200, in install_hook_envs
    _hook_install(hook)
  File "c:\program files\python37\lib\site-packages\pre_commit\repository.py", line 83, in _hook_install
    hook.prefix, hook.language_version, hook.additional_dependencies,
  File "c:\program files\python37\lib\site-packages\pre_commit\languages\python.py", line 197, in install_environment
    prefix, ('pip', 'install', '.') + additional_dependencies,
  File "c:\program files\python37\lib\site-packages\pre_commit\languages\helpers.py", line 25, in run_setup_cmd
    cmd_output_b(*cmd, cwd=prefix.prefix_dir)
  File "c:\program files\python37\lib\site-packages\pre_commit\util.py", line 156, in cmd_output_b
    raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: <unprintable CalledProcessError object>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions