Skip to content

[BUG] setup installs user egg links to python3.1 site under Python 3.10 #3001

@jameskirkwood

Description

@jameskirkwood

setuptools version

setuptools===60.2.0

Python version

Python 3.10

OS

Manjaro Linux

Additional environment information

No response

Description

Using the deprecated workflow and Python 3.10, python setup.py develop --user attempts to install an egg link to ~/.local/lib/python3.1/site-packages (but aborts as Python will not find packages here).

Provided setup.py implements this workaround for a pip bug preventing editable user installs, pip install -e . --user thinks installation is successful, but the egg link is installed to the 3.1 user site.

Expected behavior

Running pip install -e . (without access to system site), pip install -e . --user or python setup.py develop --user installs an egg link to ~/.local/lib/python3.10/site-packages.

How to Reproduce

  1. Change to an empty directory
  2. Run python -c 'from setuptools import setup; setup()' develop --user

Output

running develop
/home/user/.local/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/home/user/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/bin/python -E -c pass
TEST FAILED: /home/user/.local/lib/python3.1/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:

    /home/user/.local/lib/python3.1/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.
/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.2.15-build-libtorrent-rasterbar-src-libtorrent-rasterbar-1.2.15-bindings-python is an invalid version and will not be supported in a future release
  warnings.warn(
running egg_info
creating UNKNOWN.egg-info
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
running build_ext

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.bug
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions