Managing Python project dependencies
Brief introduction
In the runtime environment provided by the platform, users may also need to install other Python dependencies, but with standard Python packaging methods, users declare dependencies in setup.py
so that the service installs user-specified dependencies prior to starting a training task.
Usage example
When we package the application code, we add the dependencies in setup.py
, and no other declarations are required.
import setuptools
setuptools.setup(name="trainer", version="1.0", packages=["trainer"], install_requires=["requests>=2.6.0"])
Note that this method can only manage Python-related dependencies. If you need to manage other dependencies, please see Customizing Training Task Docker Images.