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

Pip Install Fails with SetuptoolsDeprecationWarning #5

Closed
prcutler opened this issue Mar 10, 2021 · 12 comments
Closed

Pip Install Fails with SetuptoolsDeprecationWarning #5

prcutler opened this issue Mar 10, 2021 · 12 comments

Comments

@prcutler
Copy link

I'm running a virtual environment with the latest Python from Homebrew on macOS:

python --version
Python 3.9.2

I'm taking the FastAPI Web App course and I'm trying to install fastapi-chameleon from both this repo and my fork both error out:

 silversaucer> pip install git+https://github.com/mikeckennedy/fastapi-chameleon

Collecting git+https://github.com/mikeckennedy/fastapi-chameleon
  Cloning https://github.com/mikeckennedy/fastapi-chameleon to /private/var/folders/y8/p92hytfj04b7_92zv1ppn1s00000gn/T/pip-req-build-mp91okuf
  Running command git clone -q https://github.com/mikeckennedy/fastapi-chameleon /private/var/folders/y8/p92hytfj04b7_92zv1ppn1s00000gn/T/pip-req-build-mp91okuf
    ERROR: Command errored out with exit status 1:
     command: /Users/prcutler/workspace/silversaucer/.venvfastapi/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/y8/p92hytfj04b7_92zv1ppn1s00000gn/T/pip-req-build-mp91okuf/setup.py'"'"'; __file__='"'"'/private/var/folders/y8/p92hytfj04b7_92zv1ppn1s00000gn/T/pip-req-build-mp91okuf/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/y8/p92hytfj04b7_92zv1ppn1s00000gn/T/pip-pip-egg-info-z72h9h4o
         cwd: /private/var/folders/y8/p92hytfj04b7_92zv1ppn1s00000gn/T/pip-req-build-mp91okuf/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/prcutler/workspace/silversaucer/.venvfastapi/lib/python3.9/site-packages/setuptools/__init__.py", line 14, in <module>
        from setuptools.dist import Distribution
      File "/Users/prcutler/workspace/silversaucer/.venvfastapi/lib/python3.9/site-packages/setuptools/dist.py", line 30, in <module>
        from . import SetuptoolsDeprecationWarning
    ImportError: cannot import name 'SetuptoolsDeprecationWarning' from partially initialized module 'setuptools' (most likely due to a circular import) (/Users/prcutler/workspace/silversaucer/.venvfastapi/lib/python3.9/site-packages/setuptools/__init__.py)
    ----------------------------------------
WARNING: Discarding git+https://github.com/mikeckennedy/fastapi-chameleon. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

All my Python modules appear up to date:

Screen Shot 2021-03-10 at 10 38 14 AM

Is there something I'm missing or I should try? Is there any other info needed?

Thanks!

@prcutler
Copy link
Author

I can also come to office hours tomorrow if that helps.

@mikeckennedy
Copy link
Owner

Thanks Paul! I'll have a look and see what's up.

@mikeckennedy
Copy link
Owner

Ok, this will take some investigations.. not sure what's up:

Screen Shot 2021-03-10 at 9 42 06 AM

@mikeckennedy
Copy link
Owner

Paul, can you go and create a totally new and clean VENV and try it there? I'm asking because it looks like setuptools may be a little wonky.

$ python3 -m venv venv
$ . venv/bin/activate
(venv) $ pip install -U pip setuptools wheel
(venv) $ # cross fingers ;)
(venv) $ pip install git+https://github.com/mikeckennedy/fastapi-chameleon

Check out this error in your list:

ImportError: cannot import name 'SetuptoolsDeprecationWarning' from partially initialized module 'setuptools' (most likely due to a circular import) (/Users/prcutler/workspace/silversaucer/.venvfastapi/lib/python3.9/site-packages/setuptools/__init__.py)

--> partially initialized module 'setuptools'

I'm not 100% sure but that seems to be a problem in setuptools not our package itself.

@prcutler
Copy link
Author

Thanks - manually creating the venv in the terminal works.

I'm guessing this is a PyCharm error - I did re-create a second empty venv in PyCharm, and it produced another error. (Maybe you can reproduce in PyCharm? Create a new virtual environment from Edit Configuration)

Working directly in the terminal works great! (I should have tried that, I'm so used to working in PyCharm!)

Successfully built fastapi-chameleon
Installing collected packages: typing-extensions, starlette, pydantic, fastapi, Chameleon, fastapi-chameleon
Successfully installed Chameleon-3.9.0 fastapi-0.63.0 fastapi-chameleon-0.1.6 pydantic-1.8.1 starlette-0.13.6 typing-extensions-3.7.4.3

Thanks for getting back to me so quickly .

@mikeckennedy
Copy link
Owner

Glad it works. Sounds like a pycharm bug. Weird.

@Isaac3N
Copy link

Isaac3N commented Dec 23, 2021

Hey, I was having the same issue while I was trying to install my fast API with pip install 'fastapi[all]' and
(venv) $ pip install -U pip setup tools wheel
helped fix the issue thanks mike, you are a life saver.

@mikeckennedy
Copy link
Owner

Glad it was helpful @Isaac3N !

Just in case others are following along, no space on setup tools ;)

(venv) $ pip install -U pip setuptools wheel

@CruzanCaramele
Copy link

@mikeckennedy pip install fastapi_chameleon is successfull with no errors but actually, nothing gets installed.
I had to user pip install git+https://github.com/mikeckennedy/fastapi-chameleon instead

@mikeckennedy
Copy link
Owner

Hi @CruzanCaramele There must be an error with your virtual environment. Once not active, another time it was, or another environment or something. Here's an animation of showing pip install fastapi_chameleon work on a fresh setu

i3.mp4

@CruzanCaramele
Copy link

@mikeckennedy what worked for me was pip install fastapi-chameleon instead of fastapi_chameleon

@mikeckennedy
Copy link
Owner

Glad you got it working.

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

No branches or pull requests

4 participants