[英]How to cross-platform install a package pipenv, method depending on the platform?
我正在尝试使用pipenv将Shapely软件包安装到跨平台项目中。 但是,在Windows上,无法使用简单的pipenv install shapely
,它会为缺少的依赖dll引发错误。 为此,克里斯托弗·高尔克(Christoph Gohlke)着名的非官方包装车轮有一个预制的车轮:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
shapely = {file = "https://download.lfd.uci.edu/pythonlibs/n5jyqt7p/Shapely-1.6.4.post2-cp37-cp37m-win_amd64.whl", sys_platform = "== 'win32'"}
[dev-packages]
[requires]
python_version = "3.7"
该滚轮非常适合Windows,但仅适用于Windows。 因此,我如何在Pipfile中指定仅当平台为linux 时才可以简单地通过pipenv install shapely
如下:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
shapely = "==1.6.4.post2"
[dev-packages]
[requires]
python_version = "3.7"
还是使用pipenv无法做到这一点? 还是将我不幸的Windows同事可以重命名为Pipfile
的Pipfile.Windows
文件放在一起?
非常感谢您的指导。
linux也可以进行wheel分配,对不起,不知道您是Linux发行版,但是您可以尝试以下操作:
[packages]
# for linux
shapely = {file = "https://files.pythonhosted.org/packages/97/36/1af447160f713d72f35dd7e749788367b7a13285c4af2fbd675128aa4e99/Shapely-1.6.4.post2-cp37-cp37m-manylinux1_x86_64.whl", platform_system="Linux"}
# for windows
shapely_win = {file = "https://download.lfd.uci.edu/pythonlibs/n5jyqt7p/Shapely-1.6.4.post2-cp37-cp37m-win_amd64.whl", platform_system="Windows"}
shapely_win
名称不会影响软件包的安装
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.