After updating to access
pip, I installed Numpy, tabulate, and
prettytable. The install confirmation for Numpy and tabulate was
accompanied by a warning stating the package location and that the
location was not on
PATH. I did not receive this warning for
Are there any issues, or foreseeable future issues, if a script is installed not on
PATH? I’ve been learning Python for a few months through university (ie I’m a noob). I’m totally ignorant about where these modules should be stored to be considered on
PATH, or what problems, if any, may arise if they remain in their current location.
exact warning in cmd.exe:
WARNING: The script tabulate.exe is installed in
LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning,
Do I need to update the module’s location or add the directory to PATH? (another topic I’ll need to research)
No, you don’t need to do anything. unless you want to use the script as
Thanks in advance. While waiting, I should probably research the
differences between modules and packages, and how they relate to the
A module is a single
.py file. A package is a directory/folder with a
collection of files within it; it is common to break a module into a
package when it gets cumbersome.
WRT PyPI, everything there is called a package, even if it is a single
.py file. In that context, “packaging” is a the process of preparing a
module or (ahem) package for publication and distribution.
“scripts”: When you package something up, part of the metadata can say
that certain functions within the package can be presented as command
line tools. These are scripts.
For example, my
cs.app.ydl package contains:
ydl = cs.app.ydl:main
in its metadata, saying that the package installation should create an
executable script named “ydl” (or in your case on Windows “ydl.exe”)
which calls the
main() function in the package
cs.app.ydl as a
The error message you have is saying that the
tabulate.exe command, and that the place in which is was
installed is not in your
PATH environment setting, which governs where
to look for “commands”.
Typically, there is some kind of “activate” process people use enable
use of a particular Python environment, and one of its side effects is
to place the environment’s scripts directory in
PATH so that the
scripts which got installed in that environment are available as
You can just add that directory to your PATH to achieve the same effect
because the installed script should invoke Python in a way which
utilises the environment’s Python install.
As a specific example, I’m on UNIX (a MacBook).
My usual Python environment is a virtualenv in
~/var/venv/3 - a
virtual env is an environment derived from some specific Python install,
but separate enough that package installs live in the environment.
Now, my own
$PATH (the UNIX parallel to Windows
~/var/venv/3/bin, which is where packages install their scripts on my
system. So I have a
[~]fleet2*> py3 -m pip install tabulate
Requirement already satisfied: tabulate in ./var/venv/3.10.6_1-homebrew/lib/python3.10/site-packages (0.8.10)
[~]fleet2*> which tabulate
[~]fleet2*> ls -ld ~/var/venv/3/bin/tabulate
-rwxrwxr-x 1 cameron cameron 246 4 Oct 10:55 /Users/cameron/var/venv/3/bin/tabulate
Here’s the bit about your warning message:
You do not need that directory in your
PATH unless you want it.
Here is the
tabulate script on my machine; it was created by
when it installed the package:
[~]fleet2*> cat /Users/cameron/var/venv/3/bin/tabulate
# -*- coding: utf-8 -*-
from tabulate import _main
if __name__ == '__main__':
sys.argv = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv)
An important feature is the shebang (
#!) line at the top, which
python3 executable which will be used to run this
Because of that, I could (a) not have the venv
bin folder in my
$PATH and (b) just invoke the
tabulate script explicitly instead:
[~]fleet2*> /Users/cameron/var/venv/3/bin/tabulate --help
Usage: tabulate [options] [FILE ...]
and it would still work correctly courtesy of that shebang line. So you
do not need that folder in your
PATH inless you want the convenience
tabulate as plain command:
[~]fleet2*> tabulate --help
Usage: tabulate [options] [FILE ...]
I do. You may or may not.
On Windows, the Python launcher also understands shebang lines and the
tabulate.exe file on your Windows machine will probably be quite
similar to the one on mine but with a different shebang path.
Cameron Simpson email@example.com