# PBS cannot find Python3

**URL:** <https://community.openpbs.org/t/pbs-cannot-find-python3/3303>\
**Category:** Users/Site Administrators\
**Created:** [October 5, 2022, 6:33pm UTC](https://community.openpbs.org/t/pbs-cannot-find-python3/3303 "2022-10-05T18:33:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![round](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@round](https://community.openpbs.org/u/round)\
**Post date:** [October 5, 2022, 6:33pm UTC](https://community.openpbs.org/t/pbs-cannot-find-python3/3303/1 "2022-10-05T18:33:05Z")

</div>

Hi everyone, I’m new to PBS scripting and am having trouble working with PBS on my research groups HPC cluster. Here’s my issue:

I’ve installed Python3 to my groups cluster and ran the following PBS script:

* * *

```auto
#!/bin/bash
#PBS -N TestJobArray
#PBS -j oe
#PBS -d .
#PBS -l nodes=1:ppn=1
#PBS -l mem=256MB
#PBS -l walltime=00:01:00
#PBS -t 1-4

python3 "print(getenv('PBS_ARRAY_ID'))"

```

* * *

I run the script using `qsub <script>` and four files are created, each containing the following message:

* * *

> python3: command not found.

* * *

This is script is just a test for array jobs, but l need to run real code later so PBS not finding Python3 is a problem. The Python3 interpreter runs when called from the command line and it is in the right place in the filesystem so I’m thinking the Python3 installation is fine and the problem is with my PBS setup? Stackexchange and other internet searching has yielded no way to resolve this issue. Do I need to edit PBS to make Python3 ‘visible’ somehow? Any help is appreciated!

---

<div class="post-metadata">

**Author:** ![boboshaq](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@boboshaq](https://community.openpbs.org/u/boboshaq)\
**Post date:** [October 5, 2022, 8:06pm UTC](https://community.openpbs.org/t/pbs-cannot-find-python3/3303/2 "2022-10-05T20:06:42Z")

</div>

Hi!  
Probably python is not installed on the nodes.  
Consider to use or deploy Environment Modules on the cluster to provide software:  
[https://modules.readthedocs.io/en/latest/](https://modules.readthedocs.io/en/latest/)  
Regards!

---

<div class="post-metadata">

**Author:** ![speleolinux](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@speleolinux](https://community.openpbs.org/u/speleolinux)\
**Post date:** [October 6, 2022, 10:41pm UTC](https://community.openpbs.org/t/pbs-cannot-find-python3/3303/3 "2022-10-06T22:41:09Z")

</div>

Hi  
Login to one of youyr nodes and type:  
“which python”  
“which python2”  
“which python3”  
That will tell you the path to your installed python versions.  
Depending on your distro (Debian or RH based) there might be no “python” or it might be a symlink to one of the pythons installed.

python2 and python3 will probably be in the path “/usr/bin/”. That should be on your PATH. If not, you have something wrong with your .bash\_profile or .bashrc

You can also on a RH based system (which is prob what you have) do  
“dnf list installed | grep python3”  
which will show either python36.x86\_64 or python38.x86\_64 installed if you have installed Python 3.

Basically debug it first via a login to the node without the extra complication of a PBS script.

Mike

---

<div class="post-metadata">

**Author:** ![round](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@round](https://community.openpbs.org/u/round)\
**Post date:** [October 10, 2022, 3:26am UTC](https://community.openpbs.org/t/pbs-cannot-find-python3/3303/4 "2022-10-10T03:26:01Z")

</div>

The issue was indeed not having Python3 installed to the nodes. boboshaq, speleolinu, thank you both for your help!
