2
from instapy import InstaPy


session = InstaPy(username='name', password='password')
session.login()

(I use VSC) my code breaks at the first line with error: from clarifai.rest import ClarifaiApp, Workflow ModuleNotFoundError: No module named 'clarifai.rest'

I tried reinstalling instapy, that specific module, but nothing changed.

Edit: Yes, I have tried reinstalling clarifai and it didn't help.

Once4thewin
  • 23
  • 1
  • 5
  • Have you tried installing `clarifai` itself, as in `pip install clarifai`? – Fanchen Bao Feb 28 '23 at 19:40
  • Says requirement already satisfied – Once4thewin Feb 28 '23 at 19:51
  • Are you under virtual environment? If you are, delete it, create a new one, and start over. If you are not, you should really use it and try again. – Fanchen Bao Feb 28 '23 at 20:00
  • I am not. I don't see how using a virtual enviroment would help me, but I will try. – Once4thewin Feb 28 '23 at 20:04
  • It would help you when debugging issues like this. I suspect your problem has something to do with incorrect PYTHONPATH. With virtual environment, you have an isolated environment such that issues with import can be more easily tracked down. – Fanchen Bao Feb 28 '23 at 20:08
  • @FanchenBao Still the same error. I went to the .py script that the error was referring to and # this "from clarifai.rest import ClarifaiApp, Workflow", since there was an error with this. My script worked, but I'm p sure that this is a wrong way to fixing things. – Once4thewin Feb 28 '23 at 20:35
  • Try [this](https://github.com/InstaPy/InstaPy/issues/6680#issuecomment-1434696781). Same problem as yours raised as an issue on instapy's repo. Might work for you. – Fanchen Bao Feb 28 '23 at 21:44
  • One last thing, this project does not seem to be in a healthy shape. See [this PR](https://github.com/InstaPy/InstaPy/pull/6642). I'd be very cautious using it for anything beyond a quick proof of concept. – Fanchen Bao Feb 28 '23 at 21:50

1 Answers1

3

The solution is here I tested Franchen Bao's comment and it worked for me. I had this error after the emoji error. Looks like this project is a little unstable and can only handle certain versions of each package, like Franchen Bao said.

pip uninstall clarifai
pip install clarifai==2.6.2
Michael Hearn
  • 557
  • 6
  • 18
  • There is a fork of InstaPy, that has been updated a little bit: https://github.com/InstaPy2/InstaPy2 Don't know if that works any better though – cuzi Mar 16 '23 at 09:07