I'm creating PHP application which need to run python script. I must use virtualenv. In project catalog i've created env directory and inside created virtual env named python. In another catalog i've put script i'd like to run and this bash script:
#!/bin/bash
app="$(pwd)/../"
pythonEnv="${app}env/python/"
source ${pythonEnv}"bin/activate"
"${pythonEnv}bin/python" "${app}scripts/script.py arg1 arg2"
But when i run this script (using terminal so far) i got this error:
/var/www/project/scripts/../env/python/bin/python: can't open file '/var/www/project/scripts/../scripts/script.py arg1 arg2': [Errno 2] No such file or directory
Of course there is script.py in scripts directory and has right access permissions:
-rwxrwxr-x
What am I doing wrong?