question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] dead link in "bad install directory or PYTHONPATH" error/warning message

See original GitHub issue

setuptools version

49.2.1

Python version

3.10

OS

Windows

Additional environment information

No response

Description

Executing python setup.py install --prefix=<path>, when <path> is not in PYTHONPATH and is not a site dir, displays a “bad install directory or PYTHONPATH” message with a dead link:

https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations

Expected behavior

The link should be valid, or should not be displayed at all.

How to Reproduce

Execute python setup.py install --prefix=<dir> where <dir> is not in PYTHONPATH and is not a site dir.

Output

In the following, I have replaced actual paths with <path>, <path1>, and <path2>.

'From setuptools
 running build
 running build_py
 creating <path>
 creating <path>
 copying <path1> -> <path2>
 warning: build_py: byte-compiling is disabled, skipping.
 
 running install
 Checking .pth file support in <path>
 <path>\pythonw.exe -E -c pass
 TEST FAILED: <path>\Lib\site-packages\ does NOT support .pth files
 bad install directory or PYTHONPATH
 
 You are attempting to install a package to a directory that is not
 on PYTHONPATH and which Python does not read ".pth" files from.  The
 installation directory you specified (via --install-dir, --prefix, or
 the distutils default setting) was:
 
     <path>\Lib\site-packages\
 
 and your PYTHONPATH environment variable currently contains:
 
     ''
 
 Here are some of your options for correcting the problem:
 
 * You can choose a different installation directory, i.e., one that is
   on PYTHONPATH or supports .pth files
 
 * You can add the installation directory to the PYTHONPATH environment
   variable.  (It must then also be on PYTHONPATH whenever you run
   Python and want to use the package(s) you are installing.)
 
 * You can set up the installation directory to support ".pth" files by
   using one of the approaches described here:
 
   https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
 
 
 Please make the appropriate changes for your system and try again.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alanfmwcommented, Apr 27, 2022

Yes, I’ll close it.

0reactions
abravalhericommented, Apr 27, 2022

I see! Yes it does look like the link was changed to the updated URL. Should we close this issue then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

0 - Stack Overflow
pth files error: bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH...
Read more >
Nmap Change Log
List of the most recent changes to the free Nmap Security Scanner. ... in debug output nor a "ERROR: script execution failed" message...
Read more >
Configuration Reference — Airflow Documentation
This page contains the list of all the available Airflow configurations that you can set in airflow.cfg file or using environment variables.
Read more >
Bug List
Please install the XDCtools of this version, or migrate the project to one of ... Wrong message are used for "Probably Error" items...
Read more >
Untitled
Filter out bad requires (bug #59819). - Put pstoimg and texexpand in tetex-latex where they belong. - Adjust file list counts for sanity...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found