Pipenv is inaccurate in installing dependencies

30 Views Asked by At

I need torch/torchvision/torchaudio and associated dependencies for a project. I'm using pipenv in order to track the python dependencies, and hopefully be able to send things to other people and have them install everything with a simple pipenv install. I installed the torch stuff with pipenv as per this thread, substituting --index for --extra-index-url from Arcitec's accepted answer, which I believe is now necessary due to pip-env updates. However, a script I'm running in this environment is failing due to an inability to import a package called charset-normalizer.

pipenv claims that charset-normalizer is installed, from the pipenv graph feature(excerpt pasted here).

torchvision==0.15.2+cu118
├── numpy [required: Any, installed: 1.26.3]
├── pillow [required: >=5.3.0,!=8.3.*, installed: 10.2.0]
├── requests [required: Any, installed: 2.31.0]
│   ├── certifi [required: >=2017.4.17, installed: 2023.11.17]
│   ├── charset-normalizer [required: >=2,<4, installed: 2.0.12]
│   ├── idna [required: >=2.5,<4, installed: 3.6]
│   └── urllib3 [required: >=1.21.1,<3, installed: 2.1.0]

However, charset-normalizer is also not in the virtual environment site-packages location, gotten from pipenv --venv, where all the other packages seem to be. Additional attempts to install charset-normalizer with pipenv install charset-normalizer, also come up with claimed success, and no appearance of charset-normalizer alongside the other packages.

I can see the charset_normalizer folder in the site-packages of like all my pip installed stuff, and was anticipating a similar looking folder existing in the site-packages of the pipenv installed virtual environment. But it is not, despite pipenv claiming it is there. Is pipenv trying to point to my existing version? Wouldn't that defy the point of a virtual environment? Any help would be appreciated. I'm on windows unfortunately, if that's helpful.

UPDATE: It seems I could get around this with pipenv install chardet, as the ML library(whisper) seemed able to target that instead for some reason(chardet and charset-normalizer seem to server similar purposes). I'm still fascinated by how pipenv claimed that I had charset-normalizer installed and didn't actually seem to have charset-normalizer installed. There was even a bunch of hashes in the Pipfile.lock that were supposed to correspond to different versions of charset-normalizer I believe, but still no charset-normalizer on my machine. I'd be grateful for any explanation of what went on there!

0

There are 0 best solutions below