micropip
micropip copied to clipboard
Not all transitive dependencies are installed
micropip doesn't install some required transitive dependencies. (related to #201)
This is my current workaround for adding extra required transitive dependencies, maybe it's helpful in working out what's wrong?
def _add_extra_dependencies(dependencies: list[str]) -> list[str]:
"""Add extra dependencies we know some packages need.
Workaround for micropip not installing some required transitive dependencies.
pygments seems to be required to get rich to work properly, ssl is required for FastAPI and HTTPX.
See also https://github.com/pyodide/micropip/issues/201#issuecomment-2645794486.
"""
extras = []
for d in dependencies:
if d.startswith(('logfire', 'rich')):
extras.append('pygments')
elif d.startswith(('fastapi', 'httpx', 'pydantic_ai')):
extras.append('ssl')
if d.startswith('pydantic_ai'):
extras.append('typing_extensions>=4.12')
if len(extras) == 3:
break
return dependencies + extras
See https://github.com/pydantic/pydantic.run/pull/44.