[英]How to create a setuptools sdist .tar.gz package from a Conda project?
I have a PyTorch training project where dependencies are managed using conda .我有一个 PyTorch 培训项目,其中使用conda管理依赖项。 I need to package my project as a setuptools
software distribution (sdist) in a .tar.gz
file so that I can run it as a custom job in Google Cloud Platform's Vertex.AI Training service.我需要 package 我的项目作为.tar.gz
文件中的setuptools
软件分发(sdist),以便我可以在 Google Cloud Platform 的 Vertex.AI 培训服务中将其作为自定义作业运行。
I've found an official guide that explains how to generate a bdist package using Conda but I don't think I can use that in Vertex.AI.我找到了一个官方指南,解释了如何使用 Conda 生成 bdist package,但我认为我不能在 Vertex.AI 中使用它。
Is there a Conda command for generating an sdist distribution?是否有用于生成 sdist 分布的 Conda 命令? Or are there any other tools I can use to get this done automatically?或者我可以使用任何其他工具来自动完成此操作吗?
Please note: I know I can manually recreate the list of dependencies in my setuptools setup.py
file but I would rather not do that because manually maintaining two copies of the same list could link to sync issues and errors.请注意:我知道我可以在我的 setuptools setup.py
文件中手动重新创建依赖项列表,但我宁愿不这样做,因为手动维护同一列表的两个副本可能会导致同步问题和错误。
You can use python setuptools to achieve it.可以使用python setuptools来实现。 On vertex ai documentation about using Setuptools to build a source distribution to use with Vertex AI there is a complete guide on how to achieve it.在有关使用 Setuptools 构建与 Vertex AI 一起使用的源代码分发的 Vertex AI文档中,有关于如何实现它的完整指南。
Its provide you with this steps to consider when dealing with your own packages:它为您提供了在处理您自己的包裹时要考虑的这些步骤:
Note : Vertex AI suggest some alternatives to it as described on Alternatives to creating a source distribution .注意:Vertex AI 建议一些替代方案,如创建源分发的替代方案中所述。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.