Python version specified in environment variables isn't installed

I’m trying to deploy a python web service with python 3.8.9 by setting the PYTHON_VERSION environment variable to be 3.8.9, as per the documentation . However, I can not find any trace of python 3.8.9 on the VM when I shell into it.

ls -ls /usr/bin/python* and ls -ls /usr/local/bin/python* both show only show 3.7:

render@shell:~/project/src$ ls -ls /usr/local/bin/python*
 0 lrwxrwxrwx 1 root root     7 Jun 23  2021 /usr/local/bin/python -> python3
 0 lrwxrwxrwx 1 root root    14 Jun 23  2021 /usr/local/bin/python-config -> python3-config
 0 lrwxrwxrwx 1 root root     9 Jun 23  2021 /usr/local/bin/python3 -> python3.7
 0 lrwxrwxrwx 1 root root    16 Jun 23  2021 /usr/local/bin/python3-config -> python3.7-config
36 -rwxr-xr-x 2 root root 36864 Jun 23  2021 /usr/local/bin/python3.7
 0 lrwxrwxrwx 1 root root    17 Jun 23  2021 /usr/local/bin/python3.7-config -> python3.7m-config
36 -rwxr-xr-x 2 root root 36864 Jun 23  2021 /usr/local/bin/python3.7m
 4 -rwxr-xr-x 1 root root  2894 Jun 23  2021 /usr/local/bin/python3.7m-config

Additionally, poetry can not find python 3.8 either:

render@shell:~/project/src$ poetry env use 3.8
/bin/sh: 1: python3.8: not found

I’m not sure how to debug further. Am I missing something?

Hi Devon,

Could you take a look at the top of your deploy logs? That should print the version being used.

Regards,

Matt

Thanks for the reply!

It does say it’s using Python 3.8.9

Feb 17 02:29:27 PM  ==> Cloning from https://github.com/lever-ai/easel-api...
Feb 17 02:29:28 PM  ==> Checking out commit 38ff0c0d184e6be51341d7a0326face8deae5683 in branch master
Feb 17 02:29:54 PM  ==> Using Python version: 3.8.9
Feb 17 02:29:57 PM  ==> Running build command '. ./scripts/build.sh'...

However, if I shell on the box, there’s no trace of any python versions outside of 3.7. Does creating the shell (through the console) connect to a different environment? Are the specified python versions installed elsewhere (I’ve only checked /usr/bin and /usr/local/bin)?

Hi Devon,

When you SSH into the box you can checkout the python version being used with

python --version

And you can see where this is installed with

which python

Let me know if that yields the expected results.

Regards,

Matt

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.