When it is assumed that a python script is being run from pyenv virtualenv, what is the correct shebang for the file?
As an example of a test case, python is not installed by default for my system (OSX) pandas. Pyenv virtualenv venv_namedoes. I tried to get the path to the python executable from virtualenv.
$ pyenv activate venv_name
(venv_name)$ which python
/Users/username/.pyenv/shims/python
So I made my example script.py:
import pandas as pd
print 'success'
But when I tried to run the script, I received an error message:
(venv_name) $ ./script.py
./script.py: line 2: import: command not found
./script.py: line 3: print: command not found
Although running this path on the command line works fine:
(venv_name) $ /Users/username/.pyenv/shims/python script.py
success
(venv_name) $ python script.py
success
What is needed for this? Ideally, I want something in common to point to the python of any of my current venv.
xgord