我正在尝试使用pipenv将Shapely软件包安装到跨平台项目中。但是,在Windows上,不能使用简单的pipenv install shapely
安装shapely,它会为缺少的依赖dll引发错误。为此,克里斯托夫·高尔克(Christoph Gohlke)着名的unofficial package wheels提供了一种预制车轮:
[[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中指定 only (如果平台是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.Windows
的{{1}}文件?
非常感谢您提出任何建议。
答案 0 :(得分:0)
在Linux上也可以进行转轮分发,对不起,不认识您的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
名称不会影响软件包的安装