I am on a Mac with Python 2.7.11. I was creating extremely simple and understandable projects where my only requirement is that I can run python setup.py install , and for setup.py use the setup command, ideally from distutils. There are literally no other imports or code other than kwargs for setup() other than what I mark here.
I get an error when importing setup.py :
from distutils.core import setup
When I use this, I get warnings like
/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: unknown distribution parameter: 'entry_points' warnings.warn ( entry_points' msg)
If I change the import (and nothing more) to the following:
from distutils.core import setup import setuptools
Warnings go away.
Note that I do not use setuptools , just importing it changes the behavior so that it no longer generates warnings. For me, this is the reason for the truly incomprehensible difference when some of the projects that I use give these warnings, while others do not.
It is clear that some form of "monkey patch" is occurring, and it is affected by whether this import is performed. This is probably not the situation for anyone exploring this problem, but for the narrow environment that I work in, this is the answer I was looking for.
This is consistent with another (community) comment saying that distutils should install monkeypatch setuptools and that they have a problem installing Ansible. It seems that Ansible tried to allow the installation without having setuptools in the past, and then returned to this.
https://github.com/ansible/ansible/blob/devel/setup.py
There are many things in the air ... but if you are looking for a simple answer for a simple project, you probably should just import setuptools.
AlanSE Jun 06 '18 at 13:55 2018-06-06 13:55
source share