I've seen [this](https://stackoverflow.com/questions/25546774/how-to-activate-conda-environment-in-jenkins-build?lq=1) question, but I am running on RHEL 7.3, not Windows.

With this simple Jenkins shell script:

```
#!/bin/bash
echo $PATH
echo $HOME
source /app/local/anaconda3/bin/activate py35_myenv

```

I am getting this failure:

```
$ /bin/bash /tmp/jenkins5945453203311093000.sh
/sbin:/usr/sbin:/bin:/usr/bin:/opt/teradata/client/15.10/bin:/app/local/anaconda3/bin:/opt/teradata/client/15.10/bin:/app/local/anaconda3/bin
/home/jenkins
/tmp/jenkins5945453203311093000.sh: line 4: /app/local/anaconda3/bin/activate: Permission denied

```

I tried `chmod`ing the `/app/local/anaconda3/bin/activate` file to 664 (was originally 660), but that did not help. Also tried `chmod -R o+rx /app/local/anaconda3/envs/py35_myenv` (executables under there were originally 770, now 775). That also did not help. The reason I tried that is because I am getting "Permission denied" complaints and the `jenkins` user on this machine does not belong to the group that these Anaconda files are in.

I tried adding `#!/bin/bash` to the beginning of my Jenkins script, per the suggestion [here](https://askubuntu.com/questions/756728/cannot-activate-python-virtual-env-in-jenkins-shell-script), but that did not help.

Regular, non-Jenkins users, can activate this conda environment just fine. I am trying to have Jenkins run automated scripts out of this environment but I cannot activate it within a Jenkins job.

EDIT: If I do not provide the full path to `activate`, I get "activate: No such file or directory" complaints.

EDIT: The reason `activate` is given a `chmod` of 664 (non-executable) is stated on [this answer](https://stackoverflow.com/questions/45554864/permission-denied-when-activating-venv). `activate` must be non-executable and run via `source` so it can make changes to the environment.

Jenkins version: 2.129-1.1