If you want to debug PyODPS on your on-premises machine or the resources on DataWorks cannot meet your requirements, you can migrate PyODPS nodes from DataWorks to the on-premises environment in which PyODPS nodes are deployed.
- Install PyODPS in a local environment. For more information, see Installation guide and limits.
- Create a MaxCompute entry object in the local environment.
You can execute the following statement in the DataWorks console to generate a template of the statement for creating a MaxCompute entry object. Then, you can modify the template to obtain the required statement.
print("\nfrom odps import ODPS\no = ODPS(%r, '<access-key>', %r, '<endpoint>')\n" % (o.account.access_id, o.project))
Parameter description:- <access-key>: the AccessKey pair of your Alibaba Cloud account.
- <endpoint>: the endpoint of MaxCompute. For more information, see Endpoints.
- Project name: You do not need to specify the project name in the statement for creating a MaxCompute entry object if the statement is generated by using the preceding statement.
When you migrate PyODPS nodes from DataWorks to a local environment, you can manually specify a project name in the statement for creating a MaxCompute entry object. Make sure that you understand the difference between workspaces in DataWorks and projects in MaxCompute. A DataWorks workspace in basic mode maps a MaxCompute project named in the <Project name> format, and provides a production environment for jobs in the MaxCompute project. A DataWorks workspace in standard mode maps a MaxCompute project named in the <Project name>_dev format and a MaxCompute project named in the <Project name> format. This workspace provides a development environment for jobs in the MaxCompute project named in the <Project name>_dev format and a production environment for jobs in the MaxCompute project named in the <Project name> format. For more information, see Differences between workspaces in basic mode and workspaces in standard mode.
- Place the obtained statement at the beginning of all code.