1

I am trying to run script in bash from python, but I am currently working in a virtualenv, and when my script calls on a specific program, I get "usr/bin/env: luajit: No such file or directory".

When I run the same script inside a separate bash window (outside the virtualenv), it runs perfectly.

I have a feeling it is because this program is not properly being pointed to, but have no idea how to tell my virtualenv to look for that program.. How do I get around this?

I am on Ubuntu 14.04, using python 2

jerpint
  • 399
  • 2
  • 16
  • I should mention that when running the exact same python script from outside my virtualenv, everything works fine – jerpint Jul 07 '16 at 16:56

1 Answers1

2

The answer lies in environment variables. PATH should contain the location where your luajit is.

See setting an environment variable in virtualenv for some ways to automatically set environment variables in a virtualenv (but two of the currently suggested ways require wrappers and one - editing a stock script). There's no magic: virtualenv edition by Allison Kaptur describes the (rather simple) magic behind virtualenv's work so you may be able to find an even better place to put the variable assignment in.

Community
  • 1
  • 1
ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152