I have this python package located in a github repository. I can install it from the github link directly like so :
pip install git+https://github.com/mkdocs/mkdocs.git
I would like to do the same, but install some extra dependencies. When using just the package name, we can do :
pip install mkdocs[i18n]
But if I try :
pip install git+https://github.com/mkdocs/mkdocs.git[i18n]
It fails with the following error :
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting git+https://github.com/mkdocs/mkdocs.git[i18n]
Cloning https://github.com/mkdocs/mkdocs.git[i18n] to /tmp/pip-req-build-1ykhyonq
Running command git clone -q 'https://github.com/mkdocs/mkdocs.git[i18n]' /tmp/pip-req-build-1ykhyonq
fatal: unable to access 'https://github.com/mkdocs/mkdocs.git[i18n]/': The requested URL returned error: 400
WARNING: Discarding git+https://github.com/mkdocs/mkdocs.git[i18n]. Command errored out with exit status 128: git clone -q 'https://github.com/mkdocs/mkdocs.git[i18n]' /tmp/pip-req-build-1ykhyonq Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q 'https://github.com/mkdocs/mkdocs.git[i18n]' /tmp/pip-req-build-1ykhyonq Check the logs for full command output.
How can I use extra-dependencies with github links ?
Following example 7 from https://pip.pypa.io/en/stable/cli/pip_install/#examples :
pip install "mkdocs[i18n] # git+https://github.com/mkdocs/mkdocs.git"
The '#' symbol usage is is explained in detail in PEP 440, in the section direct references.
This works:
pip install "git+https://github.com/mkdocs/mkdocs#egg=mkdocs[i18n]"
Added #egg=mkdocs.
Related
That's my question too. When I want to install mlxtend from github I got this error:
this is my code on google colab:
!pip install git+git://github.com/rasbt/mlxtend.git
and I got this error:
Collecting git+git://github.com/rasbt/mlxtend.git
Cloning git://github.com/rasbt/mlxtend.git to /tmp/pip-req-build-4jwtt0vm
Running command git clone -q git://github.com/rasbt/mlxtend.git /tmp/pip-req-build-4jwtt0vm
fatal: unable to connect to github.com:
github.com[0: 140.82.113.3]: errno=Connection timed out
WARNING: Discarding git+git://github.com/rasbt/mlxtend.git. Command errored out with exit status 128: git clone -q git://github.com/rasbt/mlxtend.git /tmp/pip-req-build-4jwtt0vm Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q git://github.com/rasbt/mlxtend.git /tmp/pip-req-build-4jwtt0vm Check the logs for full command output.
Please help me how can I fix this error. (I mean connection time out)
I tried updating pip and installing mlxtend and did not succeed.
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 want to install a package from GitHub that uses Cython (https://github.com/mlysy/kalmantv). I cloned the package locally, and after trying to install it with pip install ., I'm getting the following error:
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Processing /Users/me/Downloads/kalmantv
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk
cwd: /Users/me/Downloads/kalmantv
Complete output (6 lines):
running egg_info
writing kalmantv.egg-info/PKG-INFO
writing dependency_links to kalmantv.egg-info/dependency_links.txt
writing requirements to kalmantv.egg-info/requires.txt
writing top-level names to kalmantv.egg-info/top_level.txt
error: package directory 'eigen-3.3.7' does not exist
----------------------------------------
WARNING: Discarding file:///Users/me/Downloads/kalmantv. Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.
ERROR: Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.
I tried adding --use-feature=in-tree-build from the deprecation warning but still got the error (without the initial warning).
I saw a number of suggestions such as using pip install --upgrade pip setuptools wheel, but nothing is doing the trick. I would guess that this has a simple fix but this stuff is a little over my head and I don't want to break anything else.
What do I need to do to safely correct this issue without causing other problems?
The setup.py file has the following lines:
# path to eigen library
EIGEN_PATH = r"eigen-3.3.7"
Strangely, it seems to expect the Eigen header library to be present at that location. You can install the library with brew install eigen, or sudo apt install libeigen3-dev. Note that this may not install version 3.3.7 of the library, which the project expects. I don't know if using a newer version would cause any issues.
If you want to install version 3.3.7, you can build and install it from source with the following link by following these instructions:
https://gitlab.com/libeigen/eigen/-/releases/3.3.7
Once that's done, change to the project directory, and create a symlink to the Eigen library:
If installed with brew: ln -s /usr/local/Cellar/eigen/*/include/eigen3 eigen-3.3.7
If installed with apt: ln -s /usr/include/eigen3 eigen-3.3.7
If installed from source: /usr/local/include/eigen3 eigen-3.3.7
Once the Eigen library has been installed and made available at ./eigen-3.3.7, pip install . should work, but for good measures you should run the following command first:
pip install -U pip setuptools wheel; pip install -U cython
Refer to Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace if you run into an error like: error: no member named 'signbit' in the global namespace.
I am trying to install the disptools package by doing pip install disptools in my terminal.
The disptools package is linked here https://github.com/m-pilia/disptools.
It gives me a long error message during the installation with the main error displayed below.
Building wheel for disptools (setup.py) ... error
ERROR: Command errored out with exit status 1:
...
CMake Error:
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)`
It also includes this in the error:
File "/Users/name/anaconda3/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/6p/16591qb93vs76dysmldcz8140000gn/T/pip-install-vn5twf6v/disptools', '-DDISPTOOLS_DEBUG=OFF', '-DDISPTOOLS_OPT=OFF', '-DDISPTOOLS_VERBOSE=ON', '-DDISPTOOLS_LOW_ORDER_PD=OFF', '-DDISPTOOLS_DOUBLE=OFF', '-DDISPTOOLS_CUDA_SUPPORT=OFF', '-DDISPTOOLS_CUDA_ERROR_CHECK=ON', '-DDISPTOOLS_CUDA_ERROR_CHECK_SYNC=ON', '-DDISPTOOLS_PYTHON_SUPPORT=ON', '-DDISPTOOLS_PYTHON_C_MODULE_NAME=_disptools', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=/private/var/folders/6p/16591qb93vs76dysmldcz8140000gn/T/pip-install-vn5twf6v/disptools/build/lib.macosx-10.9-x86_64-3.6', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=build/temp.macosx-10.9-x86_64-3.6', '-DPYTHON_EXECUTABLE=/Users/name/anaconda3/bin/python3']'
returned non-zero exit status 1.
I have looked everywhere online but I couldn't really find any helpful resources for solving this problem.
Would really appreciate it if someone can help.
With commands, python -m pip install disptools you try to download, compile and install the disptools.
Compilation step fails with a CMake error that tell that it failed to find library OpenMP. You can install it on a Ubuntu/Debian distribution with
sudo apt install libomp-dev
After this, you can launch again the pip command.
I hope you will meet all compilation requirements.
If you are using Anaconda Prompt (recommended),
conda install -c conda-forge dlib
To preface, I have already seen this question Is it possible to use pip to install a package from a private github repository?
I am trying to install a package from a private repository that I have access to using pip.
I am able to directly clone it like so:
(myenv)robbie#ubuntu:~/git$ git clone git#github.com:matherbk/django-messages.git
Cloning into 'django-messages'...
remote: Counting objects: 913, done.
remote: Compressing objects: 100% (345/345), done.
remote: Total 913 (delta 504), reused 913 (delta 504)
Receiving objects: 100% (913/913), 165.73 KiB, done.
Resolving deltas: 100% (504/504), done.
But when I try to install it via pip (my virtualenv is activated):
(myenv)robbie#ubuntu:~/git$ pip install git+https://git#github.com/matherbk/django-messages.gitDownloading/unpacking git+https://git#github.com/matherbk/django-messages.git
Cloning https://git#github.com/matherbk/django-messages.git to /tmp/pip-13ushS-build
Password for 'https://git#github.com':
fatal: Authentication failed
Complete output from command /usr/bin/git clone -q https://git#github.com/matherbk/django-messages.git /tmp/pip-13ushS-build:
----------------------------------------
Command /usr/bin/git clone -q https://git#github.com/matherbk/django-messages.git /tmp/pip-13ushS-build failed with error code 128 in None
Storing complete log in /home/robbie/.pip/pip.log
I tried typing in my password but it failed. However I am ssh authenticated for git#github.com:
(myenv)robbie#ubuntu:~/git$ ssh -T git#github.com
Hi robpodosek! You've successfully authenticated, but GitHub does not provide shell access.
I can switch git#github.com to robpodosek#github.com and it lets me install via pip just fine:
(myenv)robbie#ubuntu:~/git$ pip install git+https://robpodosek#github.com/matherbk/django-messages.git
Downloading/unpacking git+https://robpodosek#github.com/matherbk/django-messages.git
Cloning https://robpodosek#github.com/matherbk/django-messages.git to /tmp/pip-SqEan9-build
Password for 'https://robpodosek#github.com':
Running setup.py egg_info for package from git+https://robpodosek#github.com/matherbk/django-messages.git
warning: no files found matching 'README'
Installing collected packages: django-messages
Running setup.py install for django-messages
warning: no files found matching 'README'
Successfully installed django-messages
Cleaning up...
However I want to do what the first mentioned article does by using git#github.com so that I don't have to add my username into a requirements.txt file and add that to version control.
Any thoughts? I previously had this working but had to boot up a fresh image. Thanks ahead of time.
It worked by using oxyum's suggestion of changing the : to a /:
pip install git+ssh://git#github.com/matherbk/django-messages.git
Make sure you use github.com/account instead of github.com:account
see Git+SSH dependencies have subtle (yet critical) differences from git clone
Had virtualenv activated and had to install a series of applications from github.com from a text file.
(venv)$ cat requirements.txt
-e git://github.com/boto/botocore.git#develop#egg=botocore
-e git://github.com/boto/jmespath.git#develop#egg=jmespath
-e git://github.com/boto/s3transfer.git#develop#egg=s3transfer
nose==1.3.3
mock==1.3.0
wheel==0.24.0
unittest2==0.5.1; python_version == '2.6'
(venv)$ pip install -r requirements.txt
Ignoring unittest2: markers 'python_version == "2.6"' don't match your environment Obtaining botocore from git+git://github.com/boto/botocore.git#develop#egg=botocore (from -r requirements.txt (line 1))
Cloning git://github.com/boto/botocore.git (to develop) to ./venv/src/botocore
fatal: unable to connect to github.com:
github.com[0: 192.30.253.112]: errno=Connection timed out
github.com[1: 192.30.253.113]: errno=Connection timed out
Command "git clone -q git://github.com/boto/botocore.git
/home/ubuntu/utils/boto3/venv/src/botocore" failed with error code 128 in None
However, as #Robeezy suggested, edited the requirement.txt and changed from
-e git://github.com...
to
-e git+https://github.com...
That is the link provided if you were to clone from the site (only options were Clone or Download).
So, thank you! It did work finally.
If you're installing with pip install git+https://github.com/repo and getting this error, make sure your username and password are correct. I was getting this error because I was incorrectly entering my password.