Skip to content

Script fails with misleading message if python command is not available #54

Closed
@HoT-1

Description

@HoT-1

If the command python is not available the following code fails to detect the location of python and continues with VIRTUALENVWRAPPER_PYTHON=''.

# Locate the global Python where virtualenvwrapper is installed.
if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ]
then
    VIRTUALENVWRAPPER_PYTHON="$(command \which python)"
fi

The result is the following output:

Command '' not found.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON= and that PATH is
set properly.

The issue can occur even if python is installed. In my case python3 was installed in WSL Ubuntu 22.04. But per default there is no link from python to python3. For this link to exists the package python-is-python3 must be installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions