Questions tagged [setup.py]

setup.py is a Python script required by libraries packaged and distributed with Distutils.

The setup.py script holds all configuration about the packaging of a Python library. It defines, for example, where the source code of the library is and what are the dependencies of the module. This information is used by distutils and/or setuptools, common Python tools for packaging.

More information can be found in the distutils docs and setuptools docs.

1744 questions
1539
votes
10 answers

What is setup.py?

What is setup.py and how can it be configured or used?
Software Enthusiastic
  • 25,147
  • 16
  • 58
  • 68
931
votes
18 answers

python setup.py uninstall

I have installed a python package with python setup.py install. How do I uninstall it?
flybywire
  • 261,858
  • 191
  • 397
  • 503
886
votes
20 answers

Why is python setup.py saying invalid command 'bdist_wheel' on Travis CI?

My Python package has a setup.py which builds fine locally on Ubuntu Trusty and on a fresh Vagrant Ubuntu Trusty VM when I provision it like this: sudo apt-get install python python-dev --force-yes --assume-yes --fix-broken curl --silent…
nokome
  • 9,834
  • 3
  • 14
  • 15
876
votes
43 answers

error: Unable to find vcvarsall.bat

I tried to install the Python package dulwich: pip install dulwich But I get a cryptic error message: error: Unable to find vcvarsall.bat The same happens if I try installing the package manually: > python setup.py install running…
okada
  • 8,769
  • 3
  • 16
  • 4
432
votes
24 answers

Python 3: ImportError "No Module named Setuptools"

I'm having troubles with installing packages in Python 3. I have always installed packages with setup.py install. But now, when I try to install the ansicolors package I get: importerror "No Module named Setuptools" I have no idea what to do…
user1994934
  • 4,323
  • 2
  • 14
  • 8
384
votes
25 answers

Standard way to embed version into Python package?

Is there a standard way to associate version string with a Python package in such way that I could do the following? import foo print(foo.version) I would imagine there's some way to retrieve that data without any extra hardcoding, since…
Dimitri Tcaciuc
  • 5,053
  • 5
  • 20
  • 22
236
votes
4 answers

requirements.txt vs setup.py

I started working with Python. I've added requirements.txt and setup.py to my project. But, I am still confused about the purpose of both files. I have read that setup.py is designed for redistributable things and that requirements.txt is designed…
lucy
  • 4,136
  • 5
  • 30
  • 47
159
votes
6 answers

How do I install Python packages in Google's Colab?

In a project, I have e.g. two different packages, How can I use the setup.py to install these two packages in the Google's Colab, so that I can import the packages?
Lin Jianjie
  • 1,590
  • 2
  • 8
  • 4
154
votes
3 answers

Difference between 'python setup.py install' and 'pip install'

I have an external package I want to install into my python virtualenv from a tar file. What is the best way to install the package? I've discovered 2 ways that can do it: Extract the tar file, then run python setup.py install inside of the…
user2125465
  • 1,595
  • 2
  • 11
  • 7
132
votes
7 answers

Post-install script with Python setuptools

Is it possible to specify a post-install Python script file as part of the setuptools setup.py file so that a user can run the command: python setup.py install on a local project file archive, or pip install for a PyPI project and the…
Chris Simpkins
  • 1,534
  • 2
  • 11
  • 13
112
votes
7 answers

No module named setuptools

I want to install setup file of twilio. When I install it through given command it is given me an error: No module named setuptools. Could you please let me know what should I do? I am using python 2.7 Microsoft Windows [Version…
user2885082
  • 1,129
  • 2
  • 7
  • 3
111
votes
4 answers

When to use pip requirements file versus install_requires in setup.py?

I'm using pip with virtualenv to package and install some Python libraries. I'd imagine what I'm doing is a pretty common scenario. I'm the maintainer on several libraries for which I can specify the dependencies explicitly. A few of my…
Joe Holloway
  • 28,320
  • 15
  • 82
  • 92
103
votes
5 answers

pip install . creates only the dist-info not the package

I am trying to make a python package which I want to install using pip install . locally. The package name is listed in pip freeze but import results in an error No module named . Also the site-packages folder does only contain a…
André Betz
  • 1,291
  • 2
  • 10
  • 9
103
votes
4 answers

Difference between entry_points/console_scripts and scripts in setup.py?

There are basically two ways to install Python console scripts to my path by setup.py: setup( ... entry_points = { 'console_scripts': [ 'foo = package.module:func', ], } ) and setup( ... scripts = [ …
Honza Javorek
  • 8,566
  • 8
  • 47
  • 66
95
votes
3 answers

What is the difference between `extras_require()` and `install_requires()` in setup.py?

I am trying to understand the difference between extras_require() and install_requires() in setup.py but haven't been able to get it. Both are used for installing Python dependencies, but what's the difference between them?
Harish R
  • 1,159
  • 2
  • 8
  • 10
1
2 3
99 100