I am on Windows 10 running Python 3.7.
I am trying to install a Python package on one of my private GitHub repositories. I want to use the GitHub deploy key
to give only read access to the single repository.
So I generated the deploy key using
ssh-keygen -t rsa -b 4096 -C "email@domain.com"
This added the private and public key to the .ssh
folder on my user machine. I then copied the public key to the deploy keys for my private GitHub python package repository.
Then I generated a virtualenv
and tried to run the command
pip install git+ssh://git@github.com/<github_username>/<repo_name>.git
but I keep getting an error saying
ERROR: Command errored out with exit status 128: git clone -q 'ssh://****@github.com/<github_username>/<repo_name>.git' 'C:\Users\Alex\AppData\Local\Temp\pip-req-build-doj1og3o' Check the logs for full command output.
I've looked at other posts with the similar issue and as far as I can tell my syntax for the installation command is correct.
Here is my error log output:
2020-10-13T09:36:22,708 Using pip 20.2.3 from c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip (python 3.7)
2020-10-13T09:36:22,710 Non-user install because user site-packages disabled
2020-10-13T09:36:22,718 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-ephem-wheel-cache-35_xjrvi
2020-10-13T09:36:22,719 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,719 Initialized build tracking at C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,719 Created build tracker: C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,721 Entered build tracker: C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,722 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-install-wco_t2va
2020-10-13T09:36:22,730 Collecting git+ssh://****@github.com/<github_username>/<repo_name>.git
2020-10-13T09:36:22,731 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-req-build-21n7avhs
2020-10-13T09:36:22,732 Cloning ssh://****@github.com/<github_username>/<repo_name>.git to c:\users\alex\appdata\local\temp\pip-req-build-21n7avhs
2020-10-13T09:36:23,013 ERROR: Command errored out with exit status 128: git clone -q 'ssh://****@github.com/<github_username>/<repo_name>.git' 'C:\Users\Alex\AppData\Local\Temp\pip-req-build-21n7avhs' Check the logs for full command output.
2020-10-13T09:36:23,016 Exception information:
2020-10-13T09:36:23,016 Traceback (most recent call last):
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\cli\base_command.py", line 228, in _main
2020-10-13T09:36:23,016 status = self.run(options, args)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
2020-10-13T09:36:23,016 return func(self, options, args)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\commands\install.py", line 324, in run
2020-10-13T09:36:23,016 reqs, check_supported_wheels=not options.target_dir
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
2020-10-13T09:36:23,016 discovered_reqs.extend(self._resolve_one(requirement_set, req))
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 388, in _resolve_one
2020-10-13T09:36:23,016 abstract_dist = self._get_abstract_dist_for(req_to_install)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 340, in _get_abstract_dist_for
2020-10-13T09:36:23,016 abstract_dist = self.preparer.prepare_linked_requirement(req)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\operations\prepare.py", line 469, in prepare_linked_requirement
2020-10-13T09:36:23,016 hashes=self._get_linked_req_hashes(req)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\operations\prepare.py", line 239, in unpack_url
2020-10-13T09:36:23,016 unpack_vcs_link(link, location)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\operations\prepare.py", line 99, in unpack_vcs_link
2020-10-13T09:36:23,016 vcs_backend.unpack(location, url=hide_url(link.url))
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 733, in unpack
2020-10-13T09:36:23,016 self.obtain(location, url=url)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 641, in obtain
2020-10-13T09:36:23,016 self.fetch_new(dest, url, rev_options)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\git.py", line 230, in fetch_new
2020-10-13T09:36:23,016 self.run_command(make_command('clone', '-q', url, dest))
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 774, in run_command
2020-10-13T09:36:23,016 log_failed_cmd=log_failed_cmd)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 166, in call_subprocess
2020-10-13T09:36:23,016 raise SubProcessError(exc_msg)
2020-10-13T09:36:23,016 pip._internal.exceptions.SubProcessError: Command errored out with exit status 128: git clone -q 'ssh://****@github.com/<github_username>/<repo_name>.git' 'C:\Users\Alex\AppData\Local\Temp\pip-req-build-21n7avhs' Check the logs for full command output.
2020-10-13T09:36:23,032 Removed build tracker: 'C:\\Users\\Alex\\AppData\\Local\\Temp\\pip-req-tracker-6m9f9yue'