M
Modularโ€ข2mo ago
maicmi

How to solve failed to solve the pypi requirements?

After install magic, I try to add pypi dependencies but I've got the error. How can I solve this error? #magic-cli
No description
4 Replies
Darin Simmons
Darin Simmonsโ€ข2mo ago
Hey, running the same commands from within a project and shell I got very similar results (mine were a bit more verbose). I did an update (on Linux) and got a different error message. ๐Ÿ˜ It appears to be two issues, one with the dependencies and one with the certificate. So I poked at the dependency resolution problem
(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic project channel add pypi
โœ” Added pypi (https://conda.anaconda.org/pypi/)
(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic search max
Using channels: conda-forge, https://conda.modular.com/max/, pypi

max release
-----------

Name max
Version 24.5.0
Build release
[snipped for Discord]
...
(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic search fastapi
Using channels: conda-forge, https://conda.modular.com/max/, pypi

fastapi pyhd8ed1ab_0
--------------------

Name fastapi
Version 0.115.0
Build pyhd8ed1ab_0
[snipped for Discord]
...
Dependencies:
- email_validator >=2.0.0
- fastapi-cli >=0.0.5
- httpx >=0.23.0
- jinja2 >=2.11.2
- pydantic >=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0
- python >=3.8
- python-multipart >=0.0.7
- starlette >=0.37.2,<0.39.0
- typing-extensions >=4.8.0
- uvicorn >=0.12.0
(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic search fastapi[standard]
Using channels: conda-forge, https://conda.modular.com/max/, pypi
ร— 'fastapi[standard]' is not a valid package name. Package names can only contain 0-9, a-z, A-Z, -, _, or .

(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic add fastapi
โœ” Added fastapi >=0.115.0,<0.116
(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic project channel add pypi
โœ” Added pypi (https://conda.anaconda.org/pypi/)
(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic search max
Using channels: conda-forge, https://conda.modular.com/max/, pypi

max release
-----------

Name max
Version 24.5.0
Build release
[snipped for Discord]
...
(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic search fastapi
Using channels: conda-forge, https://conda.modular.com/max/, pypi

fastapi pyhd8ed1ab_0
--------------------

Name fastapi
Version 0.115.0
Build pyhd8ed1ab_0
[snipped for Discord]
...
Dependencies:
- email_validator >=2.0.0
- fastapi-cli >=0.0.5
- httpx >=0.23.0
- jinja2 >=2.11.2
- pydantic >=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0
- python >=3.8
- python-multipart >=0.0.7
- starlette >=0.37.2,<0.39.0
- typing-extensions >=4.8.0
- uvicorn >=0.12.0
(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic search fastapi[standard]
Using channels: conda-forge, https://conda.modular.com/max/, pypi
ร— 'fastapi[standard]' is not a valid package name. Package names can only contain 0-9, a-z, A-Z, -, _, or .

(manifest_test) darin@home:/media/darin/M2/magic/manifest_test$ magic add fastapi
โœ” Added fastapi >=0.115.0,<0.116
I was unable to find fastapi[standard]. You can add the pypi channel with magic project channel add pypi. (I understand if that's not what you want to do, just reporting what did work) Interestingly/oddly I did try magic add --pypi fastapi - that is all depending of course, if you are looking for fastapi instead of fastapi[standard - I got the same certificate failed to validate error...
(two) darin@home:/media/darin/M2/magic/two$ magic add --pypi fastapi
โ ’ default:linux-64 [00:00:06] resolving pypi dependencies ร— failed to solve the pypi requirements of 'default' 'linux-64'
โ”œโ”€โ–ถ failed to resolve pypi dependencies
โ”œโ”€โ–ถ Request failed after 3 retries
โ”œโ”€โ–ถ error sending request for url (https://pypi.org/simple/fastapi/)
โ”œโ”€โ–ถ client error (Connect)
โ”œโ”€โ–ถ error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:2091: (unable to get local issuer certificate)
โ•ฐโ”€โ–ถ error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:2091:
(two) darin@home:/media/darin/M2/magic/two$ magic add --pypi fastapi
โ ’ default:linux-64 [00:00:06] resolving pypi dependencies ร— failed to solve the pypi requirements of 'default' 'linux-64'
โ”œโ”€โ–ถ failed to resolve pypi dependencies
โ”œโ”€โ–ถ Request failed after 3 retries
โ”œโ”€โ–ถ error sending request for url (https://pypi.org/simple/fastapi/)
โ”œโ”€โ–ถ client error (Connect)
โ”œโ”€โ–ถ error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:2091: (unable to get local issuer certificate)
โ•ฐโ”€โ–ถ error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:2091:
Joe
Joeโ€ข2mo ago
Try downgrading magic to 0.2.3 for now, see https://github.com/modularml/mojo/pull/3545. FYI @Zac Bowling
GitHub
Build software better, together
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
From An unknown user
From An unknown user
From An unknown user
maicmi
maicmiOPโ€ข2mo ago
Thanks @Joe Loser for the solution, and thanks @Darin Simmons for the detail explanation. $ magic self-update --version 0.2.3 โœ” magic will be updated from 0.3.0 to 0.2.3 โœ” magic archive downloaded. โœ” magic archive uncompressed. โœ” magic has been updated to version 0.2.3.
Joe
Joeโ€ข2mo ago
No problem, happy to help. https://github.com/prefix-dev/pixi/issues/1982 is the relevant upstream bug that is present in magic 0.3.0
GitHub
Invalid peer certificate with --tls-no-verify ยท Issue #1982 ยท pre...
Checks I have checked that this issue has not already been reported. I have confirmed this bug exists on the latest version of pixi, using pixi --version. Reproducible example Issue description I i...
Want results from more Discord servers?
Add your server