Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import name "Feature" from "setuptools" in version 46.0.0 #2017

Closed
pantunes opened this issue Mar 8, 2020 · 19 comments · May be fixed by elastic/spring-petclinic#3
Closed

Cannot import name "Feature" from "setuptools" in version 46.0.0 #2017

pantunes opened this issue Mar 8, 2020 · 19 comments · May be fixed by elastic/spring-petclinic#3

Comments

@pantunes
Copy link

pantunes commented Mar 8, 2020

Your last version is giving the following error:

ImportError: cannot import name 'Feature' from 'setuptools'

@cristianozhang
Copy link

I got same issue

@pganssle
Copy link
Member

pganssle commented Mar 9, 2020

This appears to be a deprecated API that was first removed in version 3.0 (41 major versions ago). Not sure why it was put back, but it was deprecated in issue #65 and most recently removed in #1979 .

If it causes problems for you I think pinning to setuptools < 46 while you find another solution is the right way to go.

@ThomasLecocq ThomasLecocq mentioned this issue Mar 9, 2020
9 tasks
openstack-gerrit pushed a commit to openstack/requirements that referenced this issue Mar 10, 2020
setuptools 46.0.0 contradicts pyScss 1.3.4 because 'Feature' were deprecated.
Please see pypa/setuptools#2017

Change-Id: Iafab38336daf5d84ef9e19248b59adccfacc29ec
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Mar 10, 2020
* Update requirements from branch 'master'
  - Skip setuptools 46.0.0
    
    setuptools 46.0.0 contradicts pyScss 1.3.4 because 'Feature' were deprecated.
    Please see pypa/setuptools#2017
    
    Change-Id: Iafab38336daf5d84ef9e19248b59adccfacc29ec
openstack-gerrit pushed a commit to openstack/requirements that referenced this issue Mar 13, 2020
setuptools 46.0.0 contradicts pyScss 1.3.4 because 'Feature' were deprecated.
Please see pypa/setuptools#2017.

For more details please see Iafab38336daf5d84ef9e19248b59adccfacc29ec

Change-Id: I7483de7478baf454bf8cf518c3e0e515b991e00d
Related-Bug: #1866961
@pganssle pganssle changed the title v46.0.0 Cannot import name "Feature" from "setuptools" in version 46.0.0 Mar 13, 2020
@pganssle
Copy link
Member

Closing this as it was an intended change. Thank you for reporting this!

@dwilhel1
Copy link

pinning to setuptools < 46 while you find another solution is the right way to go.

I'm a little new to Python-related utils and such, here's the command I had to use to resolve this: pip3 install setuptools==45

@levsa
Copy link

levsa commented Apr 8, 2020

I don't understand this error, why is setuptools/__init__.py still importing Feature if it is removed? Because I see the error there (in a docker build based on python3.7-stretch):

ImportError: cannot import name 'Feature' from 'setupt...r/local/lib/python3.7/site-packages/setuptools/__init__.py

@gkulkarni21
Copy link

pinning to setuptools < 46 while you find another solution is the right way to go.

I'm a little new to Python-related utils and such, here's the command I had to use to resolve this: pip3 install setuptools==45

I tried this but still getting error saying: ImportError: cannot import name 'Feature' from 'setuptools' (/usr/local/lib/python3.7/site-packages/setuptools/init.py)

@gkulkarni21
Copy link

pinning to setuptools < 46 while you find another solution is the right way to go.

I'm a little new to Python-related utils and such, here's the command I had to use to resolve this: pip3 install setuptools==45

I tried this but still getting error saying: ImportError: cannot import name 'Feature' from 'setuptools' (/usr/local/lib/python3.7/site-packages/setuptools/init.py)

I was able to overcome this by setting zope.interface version to greater than 5.0.0 in requirements.txt

@lwalejko
Copy link

I see that it was removed in #65, re-introduced in #161, and removed again in #1979

bmw pushed a commit to certbot/certbot that referenced this issue Aug 4, 2020
…ip continues to play with us. (#23)

So, setuptools broke the installation setup, by removing a deprecated API that is still used by some of our dependencies (see pypa/setuptools#2017)

This PR fixes the Docker build by using pipstrap to pin pip/setuptools/wheels, like it is done in several critical places (certbot-auto, ...).

An issue in certbot is opened to fix more generally the problem in most recent versions of setuptools: #7976

It rebuilt locally all dockers (certbot + dns plugins) for the three architectures, and all have passed.
sumanthratna added a commit to sumanthratna/viewmask that referenced this issue Aug 14, 2020
ideepika pushed a commit to ceph/ceph-ci that referenced this issue Sep 3, 2020
in case we need to use ubuntu xenial for testing, xenial only had python
3.5 packaged. and tempest 23.0 was the last version which supports
python3.5 and python2.7.

also do not replace link in tox.ini, as it is reachable.

to address the issues of

- pallets/markupsafe#116
- pypa/setuptools#2017

MarkupSafe is installed by
https://opendev.org/openstack/requirements/raw/branch/stable/pike/upper-constraints.txt

Signed-off-by: Kefu Chai <kchai@redhat.com>
tuxiedev added a commit to tuxiedev/stocksbeat that referenced this issue Oct 11, 2020
miku added a commit to miku/sundaypython that referenced this issue Oct 15, 2020
@SwapnilSoni1999
Copy link

Issue is still present

TechnoConserve added a commit to TechnoConserve/personal_website that referenced this issue Feb 5, 2021
To get around the issue described here: pypa/setuptools#2017

Signed-off-by: Avery Uslaner <uslaner.avery@gmail.com>
@p-mongo
Copy link

p-mongo commented Feb 11, 2021

So this removal of Feature (whatever it actually is/was/was used for) appears to be an incompatible change. I understand that incompatible changes may be made but as a user I expect them to be documented in some way with a description of the change and steps needed to be taken in client code to deal with the change. For this particular change it seems that there isn't any documentation which creates a poor user experience for, it looks like, quite a large number of users.

@AgentIvan
Copy link

how if use:
python -m pip install --upgrade pip setuptools wheel
?

@dyerdave-cvs
Copy link

When using poetry,

poetry run pip3 install setuptools==56.0.0

worked for me. HTH.

@rufatpro
Copy link

Fixed when I use Python 3.8 and pip3 install setuptools==57.4.

@rufatpro
Copy link

But it doesn't work on Windows when I use Python 3.9 or Python 3.10 with any version of setuptools.

@abravalheri
Copy link
Contributor

Hi @rufatpro, according to #2017 (comment), the issue reported here is caused by a deprecated functionality removed long time ago.

Since setuptools does not provide LTS support for old versions, the best action forward is to try updating your dependencies and/or inform the maintainers of third party libraries if they are still relying on Features, as indicated in #2017 (comment).

wmfgerrit pushed a commit to wikimedia/analytics-reportupdater that referenced this issue Aug 16, 2022
The build is currently failing during the installation of Jinja@2.6 with
an error like:

    File "..."
        from setuptools import setup, Extension, Feature
    ImportError: cannot import name 'Feature'

It appears that Feature was a deprecated API that was removed,
reintroduced, and then removed again [0].

Bumping the minor version of the dependency to 2.7 fixes this issue. The
release notes for Jinja@2.7 are available here:
https://github.com/pallets/jinja/blob/2.7/CHANGES#L4

[0] pypa/setuptools#2017 (comment)

Change-Id: I9cdf088c3bef8fbcbbdf540a5022a2341aab111f
Sihao added a commit to Sihao/get_citing_authors that referenced this issue Dec 27, 2022
tanaypf9 pushed a commit to tanaypf9/pf9-requirements that referenced this issue May 20, 2024
setuptools 46.0.0 contradicts pyScss 1.3.4 because 'Feature' were deprecated.
Please see pypa/setuptools#2017

Change-Id: Iafab38336daf5d84ef9e19248b59adccfacc29ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.