pypa / pypa/setuptools

[BUG] Mac OS 14.2.1 setup.py install failed

Open
#4,166 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Needs Triage Waiting User Feedback
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

setuptools version

setuptools==69.0.3

Python version

Python 3.9

OS

Mac OS 14.2.1

Additional environment information

pip==23.3.2

Description

try to install using: pip install -e . but failed.

My system path is:
['',
'/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python39.zip',
'/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9',
'/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/lib-dynload',
'/Users/nick.cheng/Library/Python/3.9/lib/python/site-packages',
'/Users/nick.cheng/Documents/WorkSpace/llama_index',
'/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages']

but setuptools cannot find the right path

===Log===
Checking .pth file support in /Users/nick.cheng/Library/Python/3.9/lib/python3.9/site-packages
/Library/Developer/CommandLineTools/usr/bin/python3 -E -c pass
TEST FAILED: /Users/nick.cheng/Library/Python/3.9/lib/python3.9/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:

    /Users/nick.cheng/Library/Python/3.9/lib/python3.9/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.pypa.io/en/latest/deprecated/easy_install.html#custom-installation-locations


Please make the appropriate changes for your system and try again.
Expected behavior

install into '/Users/nick.cheng/Library/Python/3.9/lib/python/site-packages'

How to Reproduce

git clone https://github.com/geekan/MetaGPT.git
cd /your/path/to/MetaGPT
pip install -e .

Output
    Checking .pth file support in /Users/nick.cheng/Library/Python/3.9/lib/python3.9/site-packages
    /Library/Developer/CommandLineTools/usr/bin/python3 -E -c pass
    TEST FAILED: /Users/nick.cheng/Library/Python/3.9/lib/python3.9/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:

        /Users/nick.cheng/Library/Python/3.9/lib/python3.9/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.pypa.io/en/latest/deprecated/easy_install.html#custom-installation-locations


    Please make the appropriate changes for your system and try again.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report by cloning MetaGPT and running pip install -e . with Python 3.9, setuptools 69.0.3, pip 23.3.2, and macOS 14.2.1. Start with the displayed setuptools .pth-file check and installation path; done means editable installation completes without the reported bad install directory error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.