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

Installing requirements.txt fails on Python 3.9 #108

Closed
flammable opened this issue Feb 8, 2021 · 15 comments · Fixed by #132
Closed

Installing requirements.txt fails on Python 3.9 #108

flammable opened this issue Feb 8, 2021 · 15 comments · Fixed by #132

Comments

@flammable
Copy link

I'm using Python 3.9 on the Mac that I'm running this script (it's running macOS 10.15.7). Both pip and pip3 are pointed to /Library/Frameworks/Python.framework/Versions/Current/bin/python3, which at the moment is /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.

Running pip3 install -r requirements.txt failed at the part where it's trying to install typed_ast, version 1.4.0. I found this GitHub issue where it appears this was resolved in version 1.4.2. I modified requirements.txt to include typed-ast==1.4.2 instead, and was able to install successfully. The Trakt/Plex sync works OK now.

I don't know the greater implications of this, so I figured I'd submit an issue before a pull request. If you'd like a pull request for this, just let me know.

@glensc
Copy link
Collaborator

glensc commented Mar 13, 2021

@flammable send PR, please. Also, you can use pipenv to run the app in isolation of system library versions.

@glensc
Copy link
Collaborator

glensc commented Mar 13, 2021

@flammable, @Taxel, @twolaw: do you know what for the typed-ast package is needed? git history is not useful here. it was added in 6831818 commit. when developing I removed the line from requirements, installed dependencies, and the app seems to work without errors.

@flammable
Copy link
Author

Thanks! I don't actually know what it does, just that using the newer version resolves the installation errors with Python 3.9.

I'll send a PR in a bit, but if typed-ast isn't needed at all, it's even better to not include it in the first place. :)

@flammable
Copy link
Author

Actually, looking at the readme...it appears they don't plan to support typed-ast on Python 3.8 and greater. It doesn't look like it's necessary anymore. Maybe it should just be removed from requirements.txt instead?

@glensc
Copy link
Collaborator

glensc commented Mar 13, 2021

perhaps write the dependency with version range. I've seen it being done, but don't know-how.

to my knowledge, the current code in this repo does not use Python typings (but I thought of using typings), but dependencies might, and I'm not sure, do the dependencies need or use the typings. I'm just a fly-by Python coder.

@glensc
Copy link
Collaborator

glensc commented Mar 13, 2021

@flammable so, as all that is unknown, please send PR of you changing the requirement that worked for py3.9.

@glensc
Copy link
Collaborator

glensc commented Mar 14, 2021

I think what happened was that @Taxel tried to save dependencies used in the project, and used pip freeze:

however that records down all packages installed in system, not just for current project.

@flammable
Copy link
Author

Nice find. If that's the case, it sounds like requirements.txt could probably be trimmed down.

@glensc
Copy link
Collaborator

glensc commented Mar 14, 2021

@flammable it's also possible that the dependencies at that time included the packages as sub-dependencies. and requirements.txt is flattened packages, not only top level.

@glensc
Copy link
Collaborator

glensc commented Mar 16, 2021

I'm thinking maybe should store only top-level dependencies in requirements.txt:

@twolaw, @Taxel what do you think?

@simonc56
Copy link
Collaborator

I think it's a good idea.
Using pipdeptree ?

@glensc
Copy link
Collaborator

glensc commented Mar 16, 2021

@twolaw: I already composed the list manually (plex, requests, trakt), don't have the exact list here as it's on other computer now.

the pipdeptree can give some confidence and verification.

@simonc56
Copy link
Collaborator

I made some tests.
In my opinion, requirements.txt should contain :

PlexAPI==4.4.1
python-dotenv==0.15.0
requests-cache==0.5.2
trakt==3.0.0

and PR #128 be closed (typed-ast not needed).

@glensc
Copy link
Collaborator

glensc commented Mar 18, 2021

Here's my version:

@flammable
Copy link
Author

Thank you both!

Repository owner locked as resolved and limited conversation to collaborators Jan 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants