2 years ago
#13359

pYW5n
Why the pip dependency has been satisfied but the latest version is still reinstalled(pytorch)
I have two pip package A and B,A requires pytorch version==1.7.0,and B requires pytorch version >= 1.6.0. First I installed A, and my torch version become 1.7.0,then I installed B , but B installed 1.10 when I already had 1.7
The information for installation B is as follows
...
Requirement already satisfied: threadpoolctl>=2.0.0 ...
Requirement already satisfied: pillow!=8.3.0,>=5.3.0 ...
Collecting torch>=1.6.0
Downloading .../torch-1.10.1-cp38-cp38-manylinux1_x86_64.whl (881.9 MB)
|████████████████████████████████| 881.9 MB 14 kB/s
Building wheels for collected packages: sentence-transformers
Building wheel for sentence-transformers (setup.py) ... done
Created wheel for sentence-transformers: filename=sentence_transformers-1.2.0-py3-none-any.whl size=123337 sha256=62fee2eb521dd71716d7a9dc408f3a4b9ccc60099bcdb14ea4b7d4aa1d8ffdea
Stored in directory: ...
Successfully built sentence-transformers
Installing collected packages: torch, torchvision, sentencepiece, sentence-transformers
Attempting uninstall: torch
Found existing installation: torch 1.7.0
Uninstalling torch-1.7.0:
Successfully uninstalled torch-1.7.0
My question is, why is this happening? What should I do to prevent B from reinstalling my pytorch? Or am I missing something?
Update:
My pip command(install B) is:
pip install sentence-transformers==1.2.0
A is my own package, I installed from .tar.gz file
pip install mypackage.tar.gz
And the requirements is
install_requires=[
'torch==1.7.0',
'transformers>=4.6.0'
'setuptools==38.2.4',
'dvc[webhdfs]==2.0.17',
'numpy',
]
python
pip
pytorch
requirements
0 Answers
Your Answer