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

requirements.txt not defined! #22

Closed
numberformat opened this issue Sep 2, 2023 · 3 comments
Closed

requirements.txt not defined! #22

numberformat opened this issue Sep 2, 2023 · 3 comments

Comments

@numberformat
Copy link

It is not correct to assume that everyone is running the same version of all the libraries in their virtual environments. For example I tried running test.ipynb and got the following error. I am pretty sure either I have a later version of the importlib library that depreciated the files method or an earlier version that does not have it defined.

File ~/Documents/workspace/jupyterquiz/jupyterquiz/dynamic.py:126, in display_quiz(ref, num, shuffle_questions, shuffle_answers, preserve_responses, border_radius, question_alignment, max_width, colors)
124 styles+= "}\n\n"
125 #print(styles)
--> 126 f = importlib.resources.files(package).joinpath('styles.css')
127 css = f.read_bytes()
128 styles += css.decode("utf-8")

AttributeError: module 'importlib.resources' has no attribute 'files'

Please include requiremnts.txt so we know which library versions work with this framework. BTW I am macbook M1 Pro running Ventura 13.5.1

Thanks!

@jmshea
Copy link
Owner

jmshea commented Sep 12, 2023

It doesn't look like Importlib has a version, other than the version of Python with which it is bundled -- it is one of the libraries included with Python starting at 3.1 or thereabouts.

It looks like import.resources.files() was included from 3.9, which was released in early October 2020. I haven't heard any other complaints, as I guess most people are using a version released more recently than that (almost 3 years now).

I tried to investigate whether I can specify python >= 3.9 in requirements.txt, but it is not clear to me that I can specify the Python version there. Please let me know if that is not correct.

@numberformat
Copy link
Author

I got it working. Thanks for the tips. I created a pull request for the requirements.txt please accept it.

Initially it was not working for me but after creating a new conda environment and updating to python 3.9 or above it started working. I am not sure if others that have lower python versions will know when they get an error what to do. The versions in this file are not set in stone. The project will work with later versions too. The purpose of this file is to provide a path for whomever is having issues to get it working correctly.

@numberformat
Copy link
Author

Closing.

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

2 participants