I completed the
Learn the Watson API couise.
It was more harder than others because the sample code is outdated.
I would like to share a working code, maybe it is help anyone else…
Link to Repl or GitHub
On Repl I needed to modify also the pyproject.toml file: the twitter = "^1.18.0" dependency must to change to python-twitter = "^3.5"
On my local environment I used the twitter package without any error but on Repl the code is works only with python-twitter package,
Exactly because the IBM Watson Personality Insights API is depreciated is why this course was sitting unfinished on my dashboard for years (“Learn the Watson API” doesn’t even show up in the catalogue anymore). But seeing the course forever sitting at 60% complete with no way to remove it from my dash got annoying, so I finally tried to see how far I could get, anyway.
The Codecademy code still reads as such:
from watson_developer_cloud import PersonalityInsightsV2 as PersonalityInsights
But this won’t work, obviously. In your own code you’ve written
from watson_developer_cloud import PersonalityInsightsV3
… Which is closer to the most recent version of the Watson PI API before it was discontinued, but ultimately even this became outdated as ‘watson_developer_cloud’ won’t work. The latest version of this module that would’ve worked was
from ibm_watson import PersonalityInsightsV3 as PersonalityInsights
(Note the name of the module changing from watson_developer_cloud → ibm_watson)
Indeed, I think the course is thoroughly defunct now, with the Personality Insights API being completely discontinued on 1 December 2021 (just about a month after you made this post).
So, I guess someone like me is out of luck and missed her chance to complete the course while I could’ve. Now I have to sit with it incomplete in my history forever. Ugggh.