I have a small python script
#!/usr/bin/env python3
import some_python3_module
def main():
# do stuff
if __name__ == '__main__':
main()
and cannot run this script with Python3, since ROS sets the PYTHONPATH
variable to some version 2.7.-related locations, meaning Python 3 cannot find any modules in its dist-packages
directory. I would like to override this behaviour without having to modify the outside envorinment. That is, I wish to unset PYTHONPATH
, but only for this script, and preferably from within it, so that the shebang will still work.
Is this possible?
Not sure if this is better suited to superuser.com