If you need to debug PyODPS locally or the resources on the data development platform where PyODPS is deployed cannot meet your requirements, you can migrate PyODPS nodes from the platform to a local PyODPS environment.

To migrate PyODPS nodes from a data development platform to a local PyODPS environment, perform the following steps:
  1. Install PyODPS in a local environment. For more information, see Installation guide and limits.
  2. Create a MaxCompute entry object in the local environment.
    You can execute the following statement on the data development platform to generate a template of the statement that is required to create 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 Configure 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 Basic mode and standard mode.

  3. Place the obtained statement at the beginning of all code.