pypa / pypa/setuptools

[BUG] python setup.py develop/install installs package in site-packages, but only dist-packages is on path

Open
#3,924 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

setuptools version

67.6.1

Python version

Python 3.8

OS

Ubuntu 20:04

Additional environment information

Using python 3.8 installed via apt-get.

Description

Installing a package via python setup.py develop/install on ubuntu:20.04, results in the package being installed to the wrong place, site-packages instead of dist-packages

I've confirmed previous versions of setuptools correctly install things to dist-packages (45.2.0)

Expected behavior

Running python setup.py install makes the package importable

How to Reproduce

python setup.py install with the system python on ubuntu:20.04

Output
+ python3 setup.py develop
running develop
/usr/local/lib/python3.8/dist-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
running egg_info
writing egg_link_package.egg-info/PKG-INFO
writing dependency_links to egg_link_package.egg-info/dependency_links.txt
writing top-level names to egg_link_package.egg-info/top_level.txt
reading manifest file 'egg_link_package.egg-info/SOURCES.txt'
writing manifest file 'egg_link_package.egg-info/SOURCES.txt'
running build_ext
Creating /usr/lib/python3.8/site-packages/egg-link-package.egg-link (link to .)
Adding egg-link-package 0.1.3 to easy-install.pth file

Installed /workdir/integration-tests/package-sync/dummy-packages/egg_link_package
Processing dependencies for egg-link-package==0.1.3
Finished processing dependencies for egg-link-package==0.1.3

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

Start with setuptools/command/develop.py around line 40 and reproduce the setup.py install or develop command using system Python 3.8 on Ubuntu 20.04. Trace why the egg-link is created under site-packages instead of dist-packages; done means the installed package is importable through the system Python path and existing behavior is preserved for supported environments.

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
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.