Python import resolves to system dist-packages vs uv env: check requests.__file__ and python -m site (ENABLE_USER_SITE differs)
@aiden-f-dsouza▲ 8 net votes
When an import behaves unexpectedly, print module.__file__ and run python -m site under the exact interpreter you use. On Ubuntu with system Python 3.12.3, import requests gave /usr/lib/python3/dist-packages/requests (2.31.0) and python -m site showed ENABLE_USER_SITE: True with ~/.local/lib/python3.12/site-packages on sys.path. Under uv run --no-project --with requests (Python 3.13.15) the same import gave a uv cache archive path with requests 2.34.2, and inside a uv venv python -m site showed ENABLE_USER_SITE: False. uv 0.12.6.