pip doesn't recognize installation because of missing egg information

Bug #1639354 reported by Luke Yeager
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pymongo (Debian)
Fix Released
Unknown
pymongo (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
Triaged
Medium
Unassigned

Bug Description

Ubuntu 16.04
pymongo 3.2-1build1

When most packages (i.e. numpy, scipy, flask, etc.) are installed with deb packages, they are installed in such a way that pip can see them. This is done by installing "*.egg-info/" directories (find /usr/lib/python2.7/dist-packages -type d -name '*egg*').

pymongo doesn't do this, so pip doesn't realize it is installed and will install a second copy of the library even when it's not necessary.

# install python-pymongo package
sudo apt install python-pymongo

# the package can be imported
python -c 'import pymongo'

# but pip doesn't see it
pip search pymongo

# so pip doesn't realize that the pymongo requirement is already fulfilled
pip install pymongo

Revision history for this message
Chuck Short (zulcss) wrote :

I wasn't able to reproduce this.

chuck

Changed in pymongo (Ubuntu):
status: New → Incomplete
Revision history for this message
Luke Yeager (luke-yeager) wrote :

FROM ubuntu:xenial
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        python-pymongo \
        python-pip \
    && rm -rf /var/lib/apt/lists/*
RUN python -c 'import pymongo; print pymongo.__version__, pymongo.__file__'
RUN pip list
RUN pip install pymongo
RUN python -c 'import pymongo; print pymongo.__version__, pymongo.__file__'

Revision history for this message
Luke Yeager (luke-yeager) wrote :

^ That was supposed to be an attachment. A dockerfile to repro.

The pip list command shows only one Python package installed (pip (8.1.1)).

The pip install command should do nothing, since pymongo is already installed. But instead, pip doesn't see the existing installation and re-installs the package (the newest available version from PyPI).

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for pymongo (Ubuntu) because there has been no activity for 60 days.]

Changed in pymongo (Ubuntu):
status: Incomplete → Expired
Changed in pymongo (Ubuntu):
status: Expired → New
Revision history for this message
James Page (james-page) wrote :

Fixed at 3.4.0:

drwxr-xr-x root/root 0 2017-08-04 07:50 ./usr/lib/python2.7/dist-packages/pymongo-3.4.0.egg-info/
-rw-r--r-- root/root 9088 2017-08-04 07:50 ./usr/lib/python2.7/dist-packages/pymongo-3.4.0.egg-info/PKG-INFO
-rw-r--r-- root/root 1 2017-08-04 07:50 ./usr/lib/python2.7/dist-packages/pymongo-3.4.0.egg-info/dependency_links.txt
-rw-r--r-- root/root 38 2017-08-04 07:50 ./usr/lib/python2.7/dist-packages/pymongo-3.4.0.egg-info/requires.txt
-rw-r--r-- root/root 20 2017-08-04 07:50 ./usr/lib/python2.7/dist-packages/pymongo-3.4.0.egg-info/top_level.txt

Changed in pymongo (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
Changed in pymongo (Ubuntu Xenial):
status: New → Triaged
importance: Undecided → Medium
Changed in pymongo (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.