doc-exports/docs/modelarts/umn/modelarts_13_0002.html
Lai, Weijian 4e4b2d5f6d ModelArts UMN 23.3.0 Version.
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lai, Weijian <laiweijian4@huawei.com>
Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
2024-06-26 07:03:02 +00:00

5.1 KiB

Terminal Environment Access Fails and Error Occurs When a Third-party Installation Package Iis Imported

Symptom

  • The environment failed to be accessed after the user runs the source activate xxx command in Terminal.
  • The basic framework package or the package installed by running the pip install command cannot be imported to a notebook instance.
  • The following error is displayed when you import a package to a notebook instance: ImportError: No module named XXX. As a result, the package cannot be used.

Possible Cause

Based on the preceding symptoms, the cause is that the Terminal environment is inactivated.

Solution

  1. Log in to the ModelArts management console, and choose DevEnviron > Notebooks.
  2. In the Operation column of the target notebook instance in the notebook list, click Open to go to the Jupyter page.
  3. On the Files tab page of the Jupyter page, click New and select Terminal. The Terminal page is displayed.
    Figure 1 Going to the Terminal page
  4. Run the following command to obtain the command line for activating the environment, as shown in Figure 2.
    cat /home/ma-user/README

    For example, to activate TensorFlow-1.8, run the following command to access the TensorFlow-1.8 environment and start development:

    source /home/ma-user/anaconda3/bin/activate TensorFlow-1.8
    Figure 2 Activating the Terminal environment