nammerkage
nammerkage

Reputation: 304

Pip does ONLY install old and wrong version of my own package

I am working on a package https://pypi.org/project/sgraphic/ it is at version 0.1.1 but pip does not care. It only installs version 0.0.3

I've tried many solutions suggested here without luck. Ugprading pip, installing packages with no_cache but nothing works.

Any ideas what to try?

Here is a dump of me trying to upgrade

pip install sgraphic --upgrade
Requirement already satisfied: sgraphic in /home/user/anaconda3/lib/python3.7/site-packages (0.0.3)
Collecting sgraphic
  Downloading sgraphic-0.1.1.tar.gz (4.4 kB)
Requirement already satisfied: skia-python in /home/user/anaconda3/lib/python3.7/site-packages (from sgraphic) (87.1)
Requirement already satisfied: IPython in /home/user/anaconda3/lib/python3.7/site-packages (from sgraphic) (7.22.0)
  Using cached sgraphic-0.1.0.tar.gz (4.4 kB)
  Using cached sgraphic-0.0.5-py3-none-any.whl (5.8 kB)
Requirement already satisfied: easing-functions in /home/user/anaconda3/lib/python3.7/site-packages (from sgraphic) (1.0.3)
Requirement already satisfied: numpy in /home/user/anaconda3/lib/python3.7/site-packages (from sgraphic) (1.20.3)
  Using cached sgraphic-0.0.4-py3-none-any.whl (5.8 kB)

when running pip show sgraphic i get

Name: sgraphic
Version: 0.0.3

Upvotes: 1

Views: 1254

Answers (1)

wovano
wovano

Reputation: 5093

It seems to me that the current version (0.1.1) requires PIL, which cannot be installed using pip:

pip install sgraphic==0.1.1
Collecting sgraphic==0.1.1
  Using cached sgraphic-0.1.1.tar.gz (4.4 kB)
Collecting skia-python
  Using cached skia_python-87.2-cp39-cp39-win_amd64.whl (4.3 MB)
Collecting IPython
  Using cached ipython-7.27.0-py3-none-any.whl (787 kB)
ERROR: Could not find a version that satisfies the requirement PIL (from sgraphic) (from versions: none)
ERROR: No matching distribution found for PIL

Because pip cannot install all dependencies, it fails to install sgraphic 0.1.1. However, if you do not explicitly request this version, pip will try to find an older version that it can install. Apparently, version 0.0.3 is the latest version it can install, so in your case it did that.

I think this is simply a bug in the latest versions of the sgraphic package. The code contains import PIL, but the package that contains PIL is actually called Pillow. It's also possible that (the original) PIL is supposed to be installed in another way, but I could not find any information about that.

NB: I created an issue on github to ask the author of the package. It was indeed a bug and is now fixed in version 0.1.2, which I could install successfully using pip.

Upvotes: 2

Related Questions