ERROR: InvocationError: could not find executable 'virtualenv'

Issue #155 on hold
Chris Withers created an issue

So, this is using Python 3.3.0 on Windows 7.

I see this:

<tools path>\Scripts\python.exe -c "import pip; pip.main();" install --upgrade tox

Requirement already up-to-date: tox in <tools path>\lib\site-packages
Requirement already up-to-date: virtualenv>=1.11.2 in <tools path>\lib\site-packages (from tox)
Requirement already up-to-date: py>=1.4.17 in <tools path>\lib\site-packages (from tox)

Looking at versions:

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tox
>>> tox.__version__
>>> import py
>>> py.__version__
>>> import virtualenv
>>> virtualenv.__version__

When I attempt to do:

<tool path>\Scripts\python.exe -c "import tox; tox.cmdline();" -
c tox.ini -v
using tox.ini: <workspace>\tox.ini
using tox-1.7.0 from <tools path>\lib\site-packages\tox\
py26 create: <workspace>\.tox\py26
ERROR: InvocationError: could not find executable 'virtualenv'

Stepping through _venv.VirtualEnv.getcommandpath suggests that py.path.local.sysfind is being called with:

(Pdb) self.envconfig.envbindir

...rather than the local('<tools>\\Scripts') I would expect.

This is the call to create .tox\py26, so its scripts will not exist yet.

The tox.ini in question is here:

Comments (6)

  1. Chris Withers reporter

    Yep, backing out 2280714 fixes the problem.

    Steps to reproduce:

    1. make sure your path is clean and has no virtualenv on it.
    2. create a new virtualenv on windows
    3. install tox into that virtualenv
    4. use the resultant tox.exe to run a tox.ini in another folder

    You will see the problem.

  2. Holger Krekel repo owner

    fix issue158 and fix issue155: windows/virtualenv properly works now: call virtualenv through "python -m virtualenv" with the same interpreter which invoked tox. Thanks Chris Withers, Ionel Maries Cristian.

    → <<cset a813c18ba50a>>

  3. Log in to comment