When trying to install a git repo through pip, for example:
pip install git+https://github.com/kayluhb/django-admin-bootstrapped.git#cms-2.4
it just works. But then when putting that same line in a requirements file (if that matters this requirements file is called from another requirements file) then pip can't find the branch:
Could not find a tag or branch 'cms-2.4 '
What did I miss here? An argument like -e or something?
UPDATE:
I have tried another one without the '#' version:
git+http://github.com/jmoiron/johnny-cache.git
When I manually pip install it, it just works too. But then in the requirements file it fails with:
error: The requested URL returned error: 400 Bad request while accessing http://github.com/jmoiron/johnny-cache.git /info/refs?service=git-upload-pack
fatal: HTTP request failed
Command /usr/bin/git clone -q "http://github.com/jmoiron/johnny-cache.git " /tmp/pip-GE7AOI-build failed with error code 128 in None
Have you tried with git+git instead of git+https?
Related
I would normally install a Python repository from Github using (for example):
pip install git+git://github.com/Artory/drf-hal-json#master
And concordantly, my "requirements.txt" would have git+git://github.com/Artory/drf-hal-json#master in it somewhere.
This failed today. The full traceback is below, but the relevant part is:
The unauthenticated git protocol on port 9418 is no longer supported.
Thanks Microsoft. The traceback points to this link about the update. Most of the page at the link talks about how the update is unlikely to affect many people (thanks again Microsoft), and the rest of it involves cryptography that I'm far too noob to understand. The section titled "git://" simply reads:
On the Git protocol side, unencrypted git:// offers no integrity or
authentication, making it subject to tampering. We expect very few
people are still using this protocol, especially given that you can’t
push (it’s read-only on GitHub). We’ll be disabling support for this
protocol.
This doesn't help me understand how to update my requirements.txt to make it work again. Can you tell me how to update my requirements.txt to make it work again? Full traceback below:
(venv) neil~/Documents/Code/web_app$ pip install git+git://github.com/Artory/drf-hal-json#master
Collecting git+git://github.com/Artory/drf-hal-json#master
Cloning git://github.com/Artory/drf-hal-json (to revision master) to /tmp/pip-req-build-zowfe130
Running command git clone -q git://github.com/Artory/drf-hal-json /tmp/pip-req-build-zowfe130
fatal: remote error:
The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
WARNING: Discarding git+git://github.com/Artory/drf-hal-json#master. Command errored out with exit status 128: git clone -q git://github.com/Artory/drf-hal-json /tmp/pip-req-build-zowfe130 Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q git://github.com/Artory/drf-hal-json /tmp/pip-req-build-zowfe130 Check the logs for full command output.
WARNING: You are using pip version 21.2.4; however, version 22.0.4 is available.
You should consider upgrading via the '/home/neil/Documents/Code/web_app/venv/bin/python -m pip install --upgrade pip' command.
In the URL you give to pip, the git+git says to access a Git repository (the first git) over the unauthenticated git protocol (the second git). Assuming you want to continue to use anonymous access here, you can simply rewrite the command to use git+https instead, which access a Git repository over the secure HTTPS protocol.
So your command would look like this:
$ pip install git+https://github.com/Artory/drf-hal-json#master
I just tested in a VM, and that appears to work. If you have other such URLs, changing the same way should be effective.
I am trying to install pdfminer from GitHub, and I am encountering some errors.
This threw an error:
pip install git+git://github.com/pdfminer/pdfminer.six
This threw an error:
pip install git+https://github.com/pdfminer/pdfminer.six
This threw an error:
git clone https://github.com/pdfminer/pdfminer.six
I googled for a solution online and found the ideas, listed above, from here:
How to install Python package from GitHub?
Those commands seemed to work for several other people, but these don't work for me. I am trying to run these three commands in the Anaconda Prompt. I am using Python 3.6.
Maybe something is not configured correctly on my side, but I can't imagine what it is. Or, is it something else?
BTW, here are the errors that I get:
(base) C:\Users\Excel>pip install https://github.com/pdfminer/pdfminer.six
Collecting https://github.com/pdfminer/pdfminer.six
Downloading https://github.com/pdfminer/pdfminer.six
\ 102kB 1.3MB/s
Cannot unpack file C:\Users\Excel\AppData\Local\Temp\pip-unpack-6kqx4igo\pdfmi
ner.six (downloaded from C:\Users\Excel\AppData\Local\Temp\pip-req-build-2bpsgsh
0, content-type: text/html; charset=utf-8); cannot detect archive format
Cannot determine archive format of C:\Users\Excel\AppData\Local\Temp\pip-req-bui
ld-2bpsgsh0
(base) C:\Users\Excel>pip install git+https://github.com/pdfminer/pdfminer.six
Collecting git+https://github.com/pdfminer/pdfminer.six
Cloning https://github.com/pdfminer/pdfminer.six to c:\users\excel\appdata\loc
al\temp\pip-req-build-iqvj3zbl
Error [WinError 2] The system cannot find the file specified while executing c
ommand git clone -q https://github.com/pdfminer/pdfminer.six C:\Users\Excel\AppD
ata\Local\Temp\pip-req-build-iqvj3zbl
Cannot find command 'git' - do you have 'git' installed and in your PATH?
(base) C:\Users\Excel>git clone https://github.com/pdfminer/pdfminer.six
'git' is not recognized as an internal or external command,
operable program or batch file.
I don't think you're cloning the correct url. You're getting the same "could not unpack" error as the question you linked, hinting that it might be the exact same problem.
Try:
pip install git+https://github.com/pdfminer/pdfminer.six.git
or
pip install git+git://github.com/pdfminer/pdfminer.six.git
Typically git repos end with .git, and when I added it to my clipboard from github that's the url I got.
You could also try pip install pdfminer.six, which I copied directly from their documentation: https://github.com/pdfminer/pdfminer.six/blob/master/README.md
I've had to reinstall a lot of libraries on Windows. When I want to install pycdc from github
Installing pycdc on windows.
pip install git+https://github.com/zrax/pycdc.git
I get:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\TT\AppData\Local\Temp\pip-ashu2b4z-build\setup.py
C:\Users\TT\unroll>pycdc .py
'pycdc' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\TT\unroll>pip install git+https://github.com/zrax/pycdc.git
Collecting git+https://github.com/zrax/pycdc.git
Cloning https://github.com/zrax/pycdc.git to c:\users\TT\appdata\local\temp\pip-ashu2b4z-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\TT\Anaconda3\lib\tokenize.py", line 452, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\TT\\AppData\\Local\\Temp\\pip-ashu2b4z-build\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\TT\AppData\Local\Temp\pip-ashu2b4z-build\
C:\Users\TT\unroll>pip install git+https://github.com/zrax/pycdc.git
I feel like I'm missing some dependency files
Boy do I ever regret doing a re-install. python may be nice to use but a nightmare to setup
Also:
C:\Users\TT>pip install git+ssh://git#github.com/BlahCo/search/tree/prod_release_branch/ProductName
Collecting git+ssh://git#github.com/BlahCo/search/tree/prod_release_branch/ProductName
Cloning ssh://git#github.com/BlahCo/search/tree/prod_release_branch/ProductName to c:\users\TT\appdata\local\temp\pip-6x2kywme-build
The authenticity of host 'github.com (192.30.255.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
Command "git clone -q ssh://git#github.com/BlahCo/search/tree/prod_release_branch/ProductName C:\Users\TT\AppData\Local\Temp\pip-6x2kywme-build" failed with error code 128 in None
It seems you're facing two different issues.
First, for pycdc:
Pycdc does not seems to be a python package so it does make sense to install it with pip (but it's logical that the setup.py was not found)
Checking there github (https://github.com/zrax/pycdc) it appears you need to download there source and build it.
Second, BlahCo:
You're trying to install it downloading there sources via ssh instead of https (like you tried with pycdc). If you try to use ssh, you'll need to configure your github account with your ssh public key.
The error git#github.com: Permission denied (publickey) shows that you did not configure your account correctly
For more details see: https://help.github.com/articles/connecting-to-github-with-ssh/
In your requirements, add the URL with a Personal Token to the github repo.
munch
pprint
coloredlogs
git+https://104360bcf4d8a00198bd355d73110ba75866c3e8:#github.company.com/kubernetes-paas/paas-shared-modules.git#master
Installing will use the https API instead of ssh, since you can't provide the keys.
$ pip3 install -r requirements.txt
Collecting git+https://104360bcf4d8a00198bd355d73110ba75866c3e8:#github.company.com/kubernetes-paas/paas-shared-modules.git#master (from -r requirements.txt (line 6))
Cloning https://104360bcf4d8a00198bd355d73110ba75866c3e8:#github.company.com/kubernetes-paas/paas-shared-modules.git (to master) to /private/var/folders/c8/p20lpvwn1kl7cyk7b282s3x1j2r82f/T/pip-2py7sl6t-build
I was trying to install keras (for using LSTM) on my Windows 10 system in Anaconda using the method provided by Yelaman. But after running the command pip install git+git://github.com/Theano/Theano.git, I received the following fatal error -
C:\Anaconda>pip install git+git://github.com/Theano/Theano.git
Collecting git+git://github.com/Theano/Theano.git
Cloning git://github.com/Theano/Theano.git to
c:\users\krishna\appdata\local\temp\pip-reettr-build fatal: protocol
error: bad line length character:
Er
Command "git clone -q git://github.com/Theano/Theano.git
c:\users\krishna\appdata\local\temp\pip-reettr-build" failed with
error code 128 in None
I don't have a github account but i use git using bitbucket (if that matters).
Could anyone explain to me what error I am committing and if there is a way out? My main goal is to use keras in Anaconda in Windows.
Thanks!
It seems that the error may be because we have a git repository listed as a dependency. Not still fully sure, though. (Source)
The solution is to replace pip install git+git://github.com/Theano/Theano.git with pip install git+http://github.com/Theano/Theano.git i.e. replacing the second git with http (this works since the repository is public)
I have a clone of another python project (that has a setup.py etc.) in my svn repository. I want to install tell pip to install from this directory. However it's an internal svn repo and is accessible via the svn:// scheme, not http://.
I can checkout the directory fine like so svn co svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version ./foobar, then install it with pip: pip install foobar/, however I can't make it do it all in one go.
Here is what I've tried and the output:
pip install svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
...
File ".../virtualenv/lib/python2.5/site-packages/pip-0.7.2-py2.5.egg/pip/vcs/__init__.py", line 110, in get_url_rev
url = self.url.split('+', 1)[1]
IndexError: list index out of range
and
pip install svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
...
File "...virtualenv/lib/python2.5/site-packages/distribute-0.6.10-py2.5.egg/pkg_resources.py", line 2424, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version', 'at', '+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version')
Both of these problems happen with or without #egg=packagename at the end of the URL (with the same error message).
and as an editable URL:
pip install -e svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package
Obtaining package from svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package
Checking out svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package to ../virtualenv/src/package
svn: URL 'svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package' is not properly URI-encoded
So SVN complains if there's a #egg=package at the end of the url, and if i leave it out, I get this error:
pip install -e svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
--editable=svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version is not the right format; it must have #egg=Package
How do I install a package from an SVN link with pip?
It is an open bug right now. Paul Nasrat is taking a look at it and opened and issue.
Follow the https://github.com/pypa/pip/issues/252