Questions tagged [setuptools]

setuptools is a set of enhancements to Python's distutils which simplify building, distribution and installation of Python packages.

setuptools is a (largely) drop-in replacement for distutils first published in 2004. Its most notable addition over the unmodified distutils tools was the ability to declare dependencies on other packages. It is currently recommended as a more regularly updated alternative to distutils that offers consistent support for more recent packaging standards across a wide range of Python versions.

The recommended pip installer runs all setup.py scripts with setuptools, even if the script itself only imports distutils.
This text is Copyright © 2001-2021 Python Software Foundation; All Rights Reserved.


Tag usage

  • Questions about setuptools-specific features should be tagged .
  • If a question is only about functionality common to both distutils and setuptools, the tag can be used in advance.
  • If it's unclear that the question author is using setuptools, the tag should be used instead.

Other related tags:

Modern alternatives to setuptools

Resources

3420 questions
2
votes
0 answers

Install scripts into specific directories with setuptools?

I have a project which builds an egg using setuptools: #!/usr/bin/env python2.7 # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name = "cfnupdateservice", version = "1.0.0", packages = find_packages('src'), …
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
2
votes
2 answers

Distutils: Compiling an Objective-C++ source file as part of a C++ extension

I am writing a Python extension in C++. I compile it by defining a list of the constituent source files in my setup.py file, like so: extensions = { 'im': [ "im/src/buffer.cpp", "im/src/detail.cpp", "im/src/gil.cpp", …
fish2000
  • 4,289
  • 2
  • 37
  • 76
2
votes
0 answers

setuptools compiled C extension name

I am trying to package my python project with setuptools, and in my project I used ctypes to wrap several C files and I have the following instruction in setup.py, however, when I run it, the file it produced is not c.so under a/b, instead it is…
1a1a11a
  • 1,187
  • 2
  • 16
  • 25
2
votes
0 answers

How to uninstall setuptools in mac

I try to upgrade(or uninstall) setuptools: pip install setuptools --upgrade but I got an error like this Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/basecommand.py", line 209, in…
winterszhang
  • 111
  • 1
  • 6
2
votes
1 answer

install local package into virtualenv using setuptools

I have a virtualenv with multiple little projects in it. Consider that they are all equal, so my folder structure looks something like this: categorisation_ml/ categorisation.py setup.py __init__.py nlp/ nlp.py setup.py …
Roman
  • 8,826
  • 10
  • 63
  • 103
2
votes
1 answer

How to submit a package to PyPI under a different user than my ~/.pypirc

As far as I can tell from the docs, unlike with say git and .gitignore files, setuptools will only look in your $HOME directory for a .pypirc file. Mostly I am submitting as 'myself', but now I want to submit a specific project via my employer's dev…
Anentropic
  • 32,188
  • 12
  • 99
  • 147
2
votes
2 answers

Adding tests to sdist, but not installing

I'd like to add tests to the sdist package in my setuptools distribution, but I don't want them installed / in bdist. I already have: setup( ... packages = find_packages(exclude='tests'), test_suite = "tests", ... ) But currently the…
viraptor
  • 33,322
  • 10
  • 107
  • 191
2
votes
2 answers

Relative imports and py2app?

Here's how my files are laid out: | setup.py + myapp | __init__.py | myapp.py | version.py (Hope that's clear... not too complicated, I don't think.) Here's what myapp.py contains: from fingui import Label from .version import…
ArtOfWarfare
  • 20,617
  • 19
  • 137
  • 193
2
votes
1 answer

python setup.py sdist and custom setup keywords don't play together

subtitle: Not only sdist I am trying to get the setup.py file of a package I'm working on to play nicely with sdist. The relevant parts of the setup.py file are: from setuptools.command.test import test [...] class Tox(test): "as described in …
Francesco Montesano
  • 8,485
  • 2
  • 40
  • 64
2
votes
1 answer

How do I install scipy and numpy with setuptools

I am developing a python 3.4 module which has scipy and numpy as dependencies. So I declared them in my setup.py under install_requires. Here is the minimum running example of my setup.py from setuptools import setup setup( …
dice89
  • 459
  • 5
  • 10
2
votes
1 answer

How to make changes to an egg/setuptools?

I've installed this source: https://github.com/scragg0x/FFXIV-Scraper/blob/master/setup.py But I'm fairly unfamiliar with the file structure. I'm looking to change some of the code (which should impact the lodestoner CLI). What file do I need to…
Zeno
  • 1,769
  • 7
  • 33
  • 61
2
votes
0 answers

How to install deployable app properly?

I want to deploy my python app, so planned to pack it as native .deb containing virtualenv on CI server and then distribute to servers. wheel_cache cant be used when using setup.py with install_requires. Moving all deps to requirements.txt and…
vitalii
  • 595
  • 4
  • 9
2
votes
1 answer

Unable to create documentation with Sphinx and Google docstrings

I am writing a Python API and I have documented every class and function in the sources using Google docstring convention, which I find way more readable than the Sphinx convention. I want to use Sphinx to build the documentation for my API. There…
Enaid
  • 305
  • 1
  • 18
2
votes
2 answers

Installing setuptools from source "No module named numbers" error

This is based on Install Python Flask without using pip My environment has no rpms installed or enabled, nor do I have pip, easy_install, virtualenv, etc. Based on the answer in the linked question, I need to install setuptools in order to install…
roach
  • 73
  • 7
2
votes
2 answers

setup.py nosetests command throws ImportError when specifying package_dir

When setup.py specifies a package_dir different from the package name, the setup.py nosetests function fails due to an ImportError. Following is a minimal example. directory structure: setup.py src/ __init__.py myclass.py unittests/ …
Solter
  • 21
  • 1
  • 1
1 2 3
99
100