Problem installing using conda
Hey everone. I’m trying to install transformers and datasets package using conda.I installed pytorch using conda, and I’m using miniconda with python version 3.7. My environment is also using python 3.7.Installation of transformers using the commandconda install -c huggingface transformersworks, but when testing the installation I getfrom transformers import pipelineTraceback (most recent call last):File “”, line 1, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/init.py”, line 43, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/dependency_versions_check.py”, line 36, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/file_utils.py”, line 56, inModuleNotFoundError: No module named ‘importlib_metadata’conda install importlib-metadataFile “”, line 1conda install importlib-metadata^SyntaxError: invalid syntaxI thought possibly the following would solve itconda install importlib-metadataBut when testing the installation I still get trouble:from transformers import pipelineTraceback (most recent call last):File “”, line 1, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/init.py”, line 2310, ingetattrFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/file_utils.py”, line 1660, ingetattrFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/init.py”, line 2304, in _get_moduleFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/importlib/init.py”, line 127, in import_modulereturn _bootstrap._gcd_import(name[level:], package, level)File “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/pipelines/init.py”, line 24, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/modelcard.py”, line 31, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/models/init.py”, line 19, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/models/mt5/init.py”, line 36, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/models/t5/tokenization_t5_fast.py”, line 23, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/transformers-4.4.2-py3.8.egg/transformers/tokenization_utils_fast.py”, line 25, inFile “/home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/tokenizers/init.py”, line 79, infrom .tokenizers import (ImportError: /lib64/libm.so.6: version `GLIBC_2.29’ not found (required by /home/nfs/tjviering/envs/torch3/lib/python3.7/site-packages/tokenizers/tokenizers.cpython-37m-x86_64-linux-gnu.so)Any help would be greatly appreciated!
2021-04-23T18:15:37Z
For anyone wondering how to fix this issue, I found that when using the channel conda-forge there is no issue at all. So the fix:conda install -c conda-forge transformersconda install importlib-metadata
2021-05-09T16:19:28Z
Ha thanks, Tom! I had the same import error “version `GLIBC_2.29’ not found”, uninstalling and reinstalling using conda-forge fixed the problem! Thanks again!
2021-05-19T17:33:54Z
Tom you saved my day, just want to say thanks
2021-06-13T13:41:38Z
Thanks Tom, I created the account to thank you for saving my day