我正在开发一个包https://pypi.org/project/sgraphic/,它的版本是0.1.1,但是pip并不关心。它只安装0.0.3版
我已经尝试了这里建议的许多解决方案,但都没有成功。使用no_cache安装包,但都不起作用。
有什么想法可以尝试一下吗?
这是我试图升级的一个垃圾堆
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)当运行pip show sgraphic时,我得到
Name: sgraphic
Version: 0.0.3发布于 2021-09-04 08:58:11
在我看来,当前版本(0.1.1)需要PIL,不能使用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由于pip无法安装所有依赖项,因此它无法安装图形0.1.1。但是,如果您没有明确请求此版本,pip将尝试查找它可以安装的较旧版本。显然,0.0.3版本是它可以安装的最新版本,所以在您的例子中,它就是这么做的。
我认为这只是sgraphic包最新版本中的一个bug。代码包含Pillow,但包含import PIL的包实际上称为Pillow。也有可能(最初的) PIL被认为是以另一种方式安装的,但我找不到任何关于这方面的信息。
注:我创建了一个issue on github来询问包的作者。这确实是一个错误,现在已经在0.1.2版本中修复了,我可以使用pip成功安装它。
https://stackoverflow.com/questions/69053662
复制相似问题