does not work with virtualenv

Create issue
Issue #1363 resolved
tgp created an issue

I'm running django within a virtualenv, i.e. instead of saying //python .../, I say //./pyenv/bin/python .../ or even //./pyenv/bin/ Now the problem is that within this script, there are a number of calls like //os.system('python ...')//, which use my system's Python installation and therefore lead to errors like "Unknown command: 'satchmo_copy_static'", because satchmo is not installed there, but only in the virtualenv.

I got around this py saying //export PATH=.../pyenv/bin:$PATH//, but still I guess there should be a better way to fix this; and if it's just adding a parameter //--python-executable=...// to the clonesatchmo script.

Comments (7)

  1. Hynek Cernoch

    Usual way of using virtualenv is

    $ source bin/activate

    then you need not to write "./pyenv/bin/python" but only "python". See

    There are other management commands in Django itself (e.g. "dbshell") which probably would not work without "source bin/activate" or setting PATH. Try it.

    I think, this issue is invalid. What you mean?

    P. S.: OK. I have in a drawer for long time other solution of clonesatchmo beeing developed without os.system call by the way. That's another small reason to continue with development. :-)

  2. Hynek Cernoch

    OK. I probably tried the same user mistake also, when I was a newcomer to virtualenv. It must be unfriendly for such initial command like clonesatchmo. Django can fail on less usual commands only like dbshell or compilemessages.

  3. Anand Chitipothu

    I think the script should use sys.executable to call python scripts instead of using the python from the path.

  4. Chris Moffitt repo owner

    For some reason the url to your changeset didn't come through. Could you submit a pull request or attach the patch.

  5. Log in to comment