Repository navigation
pip update error #2
Description
Activity
@HDarwin hi! You solved this problem?
Hm,
before install libapt-pkg-dev
pip install https://launchpad.net/python-apt/main/0.7.8/+download/python-apt-0.8.5.tar.gzReacted by EugenHi,
have anyone solved this issue?@HalisCz, installing
python-aptas @reddoggad suggests solves it for me.For me too. Thanks
I'm having the same problem, putting here my solution for reference.
The Pypi version of
python-aptpackage it's not updated. Usually the best is to install the system apt python-apt package, but sometimes running a virtualenv isolated from the system you also need to install the python package.I've found the Debian repository of python-apt and install it with pip using the correct branch for my system:
sudo apt-get install libapt-pkg-dev # so gcc find the <apt-pkg/hashes.h> pip install git+https://anonscm.debian.org/cgit/apt/python-apt.git@ubuntu/trustyand it works.
Reacted by David Reed, Eugen, Dmitri Kovalenko, Andrew Spiers and Alfonso Alba@tinproject I'm facing the same issue but the second command fails:
Collecting git+https://anonscm.debian.org/cgit/apt/python-apt.git Cloning https://anonscm.debian.org/cgit/apt/python-apt.git to /tmp/pip-uh0FwI-build fatal: unable to access 'https://anonscm.debian.org/cgit/apt/python-apt.git/': Failed to connect to anonscm.debian.org port 443: Connection refused Command "git clone -q https://anonscm.debian.org/cgit/apt/python-apt.git /tmp/pip-uh0 FwI-build" failed with error code 128 in NoneDid the url changed? Thanks!
EDIT: I'm using Windows 10
@aaossa You are not including the branch/tag part of the git repo at the pip command. Also I do not know why you want to install
python-aptpackage in a non Debian system...On Linux Mint 18 I've found that there is no
ubuntu/xenialbranch, but using the tag1.1.0_beta5it works.Reacted by Eugen and overratedproI tried because when I wanted to update my python packaged it was listed as outdated (
python-apt (0.9.3.5ubuntu2) - Latest: 0.7.8 [sdist]). After that I tried to update all of them but python-apt failed. I'll try your suggestiong. Thanks!The new URL is https://salsa.debian.org/apt-team/python-apt.git. Thanks @tinproject for the pointer! 🇪🇸
Reacted by overratedproJust chiming in to confirm: I had the same problem, and making this change to my
requirements.txtfile fixed it:diff --git a/requirements.txt b/requirements.txt index 92fb4e5..6ca12d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ ansible +git+https://salsa.debian.org/apt-team/[email protected] molecule psutil
In my case, though, for an Ubuntu 20.04 target, I also needed to run:
$ sudo apt install libapt-pkg-devin order for
pip install -r requirements.txtto succeed. Without this package installed, I kept getting this error:running build_ext building 'apt_pkg' extension creating build/temp.linux-x86_64-3.9 creating build/temp.linux-x86_64-3.9/python x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/evadeflow/projects/ubuntu-vm-setup/venv/include -I/usr/include/python3.9 -c python/acquire-item.cc -o build/temp.linux-x86_64-3.9/python/acquire-item.o -std=c++11 -Wno-write-strings -DAPT_8_CLEANER_HEADERS -DAPT_9_CLEANER_HEADERS -DAPT_10_CLEANER_HEADERS -DPY_SSIZE_T_CLEAN In file included from python/acquire-item.cc:24: python/apt_pkgmodule.h:14:10: fatal error: apt-pkg/hashes.h: No such file or directory 14 | #include <apt-pkg/hashes.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1But the error that started this whole odyssey was this:
Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-hcb_ok5s/python-apt/setup.py", line 6, in <module> from DistUtilsExtra.command import * ModuleNotFoundError: No module named 'DistUtilsExtra'(I'm selfishly including that last bit so that Google will lead me back to this page if/when I encounter the same error in the future...)

how can i solve it?