LOL this is not stack overflow.
And it's probably less of an NLP issue and more of a python path or environment issue.
I'm guessing you're on VSCode..?
Try Command(or Ctrl)+Shift+P then searching "select python interpreter" and actually select the python environment where you installed the transformers library.
I admit I was a bit condescending in my previous comment and I apologize for that, but this kind of response makes me think you're not really understanding the problem, and frankly it's important that you understand error messages if you want to be a good programmer.
It could have been any library you were trying to import and it would've given you the same message. Transformers was probably the first thing you were trying to import, probably the first line of code in your script. And the fact that Pylance was in the error message should've told you that this is a python or VSCode issue and has nothing to do with NLP.
Best of luck.
Try this command to check if transformers is installed:
python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('we love you'))"
When you get something like this: \[{'label': 'POSITIVE', 'score': 0.9998704791069031}\]
it should be fine
the import should work after a restart of VSCODE
LOL this is not stack overflow. And it's probably less of an NLP issue and more of a python path or environment issue. I'm guessing you're on VSCode..? Try Command(or Ctrl)+Shift+P then searching "select python interpreter" and actually select the python environment where you installed the transformers library.
its a NLP related model so settle down
I admit I was a bit condescending in my previous comment and I apologize for that, but this kind of response makes me think you're not really understanding the problem, and frankly it's important that you understand error messages if you want to be a good programmer. It could have been any library you were trying to import and it would've given you the same message. Transformers was probably the first thing you were trying to import, probably the first line of code in your script. And the fact that Pylance was in the error message should've told you that this is a python or VSCode issue and has nothing to do with NLP. Best of luck.
lol bruh don't you think that I checked all the necessary trouble shooting and then I landed here.....
Try this command to check if transformers is installed: python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('we love you'))" When you get something like this: \[{'label': 'POSITIVE', 'score': 0.9998704791069031}\] it should be fine the import should work after a restart of VSCODE