Why aren't pip-installed executables available from the command line?
There is no virtualenv-tools
executable in the virtualenv-tools
package, that's why you cannot execute it. It contains a script called virtualenv
, which you should be able to execute. Read the documentation on how to use it first:
Virtualenv has one basic command:
$ virtualenv ENV
Anyway, in general, when you install a package using pip
and it contains an executable script, it's put into the directory which should be in the PATH
environment variable to be able to execute it from anywhere. This directory depends on the system used:
- Linux:
/usr/bin
- Mac:
/usr/local/bin
(when Homebrew Python is used) - Windows:
<python_directory>/Scripts
So first, make sure the directory is in PATH
(this is mainly an issue on Windows; Linux and Mac have it by default). Second, check if the script is in the directory and is executable.
Also, many packages are just libraries without any executable, so you should always read the package documentation first to find out how to use it.
Related videos on Youtube
lindelof
Updated on September 18, 2022Comments
-
lindelof over 1 year
I've installed Python with Homebrew. I would like to use
pip
to install additional packages, some of which come with executables that are meant to be called from the command line, for examplecrossbar
orvirtualenv-tools
.But this doesn't work and I don't know why:
$ pip install virtualenv-tools Requirement already satisfied: virtualenv-tools in /usr/local/lib/python2.7/site-packages $ virtualenv-tools -bash: virtualenv-tools: command not found $ find /usr/ -name virtualenv-tools /usr//local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/virtualenv-tools
So
pip
correctly installed thevirtualenv-tools
package, including the executable, but somehow doesn't make this executable available to the command line.Am I missing something here?
-
slhck about 7 yearsWhile macOS is Unix, Homebrew does not use
/usr/bin
. It uses/usr/local/bin
instead. -
lindelof about 7 yearsThe
virtualenv-tools
package is not the same as thevirtualenv
package, and does indeed provide avirtualenv-tools
executable: pypi.python.org/pypi/virtualenv-tools. I have the same problem with installingcrossbar
withpip install crossbar
: thecrossbar
executable is not available from the command line. -
WestCoastProjects about 2 years"when you install a package using pip and it contains an executable script" . How do we tell pip to do that?