诗歌sys_plattform标记不同的Mac平台
我正在尝试使用诗歌安装程序包在Mac上安装Pytorch,我想为不同平台指定不同的轮子文件。
Pytorch的车轮适用于Intel和ARM基Mac。看来我可以使用 Markers =“ sys_platform =='macoSx'”
指定英特尔平台。如何指定基于ARM的系统?
我也想知道 macOSX
标识符是否会选择两个平台?目前,我只能访问基于Intel的Mac进行测试。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在最新诗歌1.3.1上测试的更新
,我现在成功地使用了此信息:
诗歌选择了正确的版本。
原始答案
回答您的问题的
是,在这里是最终版本:
ARM64
适用于带有M1/M2芯片的MacOS。x86_64
适用于MacOS英特尔芯片。
platform_machine
(如果使用)多个体系结构(在上面的演示中,它使用
aarch64
车轮)。中找到所有车轮URL
您可以使用Python命令找到当前的平台和体系结构:
您可以在 sys.platform 的列表。
(希望将来对Pytorch的愿望诗很聪明,这样我们就不需要手动设置它们)
UPDATE
Tested on latest Poetry 1.3.1, I succeed simply using this now:
Poetry picked right version.
Original Answer
To answer your question, it would be
Here is final version:
arm64
is for macOS with M1/M2 chip.x86_64
is for macOS withIntel chip.
platform_machine
if you are usingmultiple architectures (In the demo above, it is using
aarch64
wheel).You can find all wheel URLs at either one of
You can find your current platform and architecture by using Python command:
You can find the list of
sys.platform
at here.(Wish Poetry can be smarter for PyTorch in future so that we do not need manually set them)