Problem description:
Unable to install Python packages
Expected behavior:
Install
Actual behavior:
'HTTPResponse' object has no attribute 'strict'
at venv/lib/python3.10/site-packages/cachecontrol/serialize.py:54 in dumps
50│ ),
51│ u"status": response.status,
52│ u"version": response.version,
53│ u"reason": text_type(response.reason),
→ 54│ u"strict": response.strict,
55│ u"decode_content": response.decode_content,
56│ }
57│ }
58│
exit status 1
Replit: Package operation failed.
Steps to reproduce:
Try to install using Replit’s Package Manager
Bug appears at this link:
Browser/OS/Device:
Firefox/Windows/PC
Hi @xmagnetarai , welcome to the forums! What package are you trying to install?
Hi! Any package I try to download I get this issue. I recently tried opencv-python and urlib3
Have you tried entering pip install <module name>
?
@xmagnetarai , you can try poetry add <module name>
if that doesn’t work.
I did. It was successfully installed using pip but then I get error “missing config.py” whenever I try to import cv2
Thank you, I’ll give it a try and get back to you
xmagnetarai:
cv2
Opencv requires extra configuration, so there should be a special template for that you can use.
Thanks. Do you know where I can get the template?
I received this error:
$ poetry add opencv-python
AttributeError
'HTTPResponse' object has no attribute 'strict'
at venv/lib/python3.10/site-packages/cachecontrol/serialize.py:54 in dumps
50│ ),
51│ u"status": response.status,
52│ u"version": response.version,
53│ u"reason": text_type(response.reason),
→ 54│ u"strict": response.strict,
55│ u"decode_content": response.decode_content,
56│ }
57│ }
58│
Since that is an error with urllib3, try this:
That’s a urllib3
error (Removed the ability to do that in 2.0.0), run:
pip install --force-reinstall urllib3==1.26.15
poetry add urllib3==1.26.15
The second one ensures poetry doesn’t update it and break something unintentionally.
And as for the opencv template, you can find it here .
1 Like
It worked! thank you . Regarding the template, I forked it and it worked, but how can I integrate it into my current project?
xmagnetarai:
Regarding the template,
I’d recommend just copy-pasting your current project into your fork of the template if you’re going to use opencv.
How can I acheive that? Using git pull
?
Do you recommend making the template myself on my own project to save time or it’s a tedious process?
If your project is just one file (main.py or something), then just Ctrl +A Ctrl +C and then Ctrl +V into your forked Repl.
Probably 11 files. I’ll give it a shot
1 Like
In that case, I’d recommend downloading your repl as a ZIP, and then uploading the files you need to the new Repl.
You can download your repl as a ZIP by adding .zip
to the end of its URL (https://replit.com/@somone/example-repl.zip
).
I’m doing that! Thanks a lot for your help. I took a lot of time
1 Like
system
Closed
July 5, 2023, 5:46pm
19
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.