Having problems with downgrading python library using pip /u/Accurate_Factor_9391 Python Education

Hi guys, I’m curious about some techniques about using python libraries through pip. This is what happened.

I was downloading the transformers library, version is 4.31.0 using pip.

And then I downloaded library sentence_transformers, I didn’t designate the version, so pip downloaded the latest version of sentence_transformers for me, but it depends on latest version of transformers which is 4.46.3. So it automatically uninstall the existed transformers and upgrade it. My questions are as follows.

  1. After I downgrade the transformers again using pip install transformers==4.31.0 and then ran the code, it gave out wrong message that

ImportError: cannot import name 'is_torch_npu_available' from 'transformers' (/home/user/.conda/envs/zby_infer/lib/python3.8/site-packages/transformers/__init__.py)

But I checked online it is a feature that is_torch_npu_available is deprecated and and was taken out in 4.41.0. So I didn’t successfully downgraded the code. The situation is that now the library shows that the version is 4.31.0 now but inside it is still somewhat higher version of transformers. Is this normal and why is this happening?

  1. And also I want to ask when you guys download a python library, what you usually do to check the dependencies? I feel like it is actually annoying that pip automatically upgrade the version of the library, which cause the entire environment goes wrong.

submitted by /u/Accurate_Factor_9391
[link] [comments]

​r/learnpython Hi guys, I’m curious about some techniques about using python libraries through pip. This is what happened. I was downloading the transformers library, version is 4.31.0 using pip. And then I downloaded library sentence_transformers, I didn’t designate the version, so pip downloaded the latest version of sentence_transformers for me, but it depends on latest version of transformers which is 4.46.3. So it automatically uninstall the existed transformers and upgrade it. My questions are as follows. After I downgrade the transformers again using pip install transformers==4.31.0 and then ran the code, it gave out wrong message that ImportError: cannot import name ‘is_torch_npu_available’ from ‘transformers’ (/home/user/.conda/envs/zby_infer/lib/python3.8/site-packages/transformers/__init__.py) But I checked online it is a feature that is_torch_npu_available is deprecated and and was taken out in 4.41.0. So I didn’t successfully downgraded the code. The situation is that now the library shows that the version is 4.31.0 now but inside it is still somewhat higher version of transformers. Is this normal and why is this happening? And also I want to ask when you guys download a python library, what you usually do to check the dependencies? I feel like it is actually annoying that pip automatically upgrade the version of the library, which cause the entire environment goes wrong. submitted by /u/Accurate_Factor_9391 [link] [comments] 

Hi guys, I’m curious about some techniques about using python libraries through pip. This is what happened.

I was downloading the transformers library, version is 4.31.0 using pip.

And then I downloaded library sentence_transformers, I didn’t designate the version, so pip downloaded the latest version of sentence_transformers for me, but it depends on latest version of transformers which is 4.46.3. So it automatically uninstall the existed transformers and upgrade it. My questions are as follows.

  1. After I downgrade the transformers again using pip install transformers==4.31.0 and then ran the code, it gave out wrong message that

ImportError: cannot import name 'is_torch_npu_available' from 'transformers' (/home/user/.conda/envs/zby_infer/lib/python3.8/site-packages/transformers/__init__.py)

But I checked online it is a feature that is_torch_npu_available is deprecated and and was taken out in 4.41.0. So I didn’t successfully downgraded the code. The situation is that now the library shows that the version is 4.31.0 now but inside it is still somewhat higher version of transformers. Is this normal and why is this happening?

  1. And also I want to ask when you guys download a python library, what you usually do to check the dependencies? I feel like it is actually annoying that pip automatically upgrade the version of the library, which cause the entire environment goes wrong.

submitted by /u/Accurate_Factor_9391
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *