Search code examples
python-3.xgoogle-cloud-platformjupyter-notebookgoogle-cloud-python

google cloud: need python 3.6 and is 3.6 in ssh but still 3.5 in jupyter notebook


I need to use python 3.6 for a project and in the ssh when I typed

python3 --version
#Python 3.6.3

but in the jupyter notebook i opened, it is still

import sys
print(sys.version)
3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516]

How can I change it to python 3.6?

I can see that when I opened jupyter notebook, python3.6 is in the directory: enter image description here I know there is a similar question in stackoverflow but is not answered.


Solution

  • You could try something like:

    gcloud ai-platform jobs submit training my_job \
        --module-name trainer.task \
        --job-dir gs://my/training/job/directory \
        --package-path /path/to/my/project/trainer \
        --region us-central1 \
        --runtime-version 2.1 \
        --python-version 3.6
    

    However, looking at the runtime version list and the Setting Python version pages, I only see mentioned python 3.5 and python 3.7.

    Could you maybe try the packages you are having issues with in 3.5 in a 3.7 environment:

    gcloud ai-platform jobs submit training my_job \
        --module-name trainer.task \
        --job-dir gs://my/training/job/directory \
        --package-path /path/to/my/project/trainer \
        --region us-central1 \
        --runtime-version 2.1 \
        --python-version 3.7