Instapy: Trying out on terminal in mac?

Created on 24 Apr 2017  ·  30Comments  ·  Source: timgrossmann/InstaPy

I apologize for the dumb question here, but I'd like to give this a try before attempting to get it going on a server at Digital Ocean or on a Rasberry Pi. I've got some Python experience, but I'm not exactly sure how to run this locally and try it out. Could someone give me a "like I'm 5" version to get this going?

help wanted question

Most helpful comment

@dakshshah96 please do a pip list and make sure to find clarifai in the printed list...

Or simply do another install with pip install clarifai or pip3.<your_version> install clarifai

@dakshshah96 Also, make sure to use the search, since this definitely has been asked before...

All 30 comments

@deronsizemore Here you go.

Make sure you have downloaded the chrome driver from here https://sites.google.com/a/chromium.org/chromedriver/downloads and put that in the assets folder.

Change the quickstart.py file to suite your needs and account details.

Navigate to the folder using cd Downloads etc.

Then run python quickstart.py

Let me know if you need more detail.

Thanks. That seems easy enough.

So, once this runs, I assume it will just continue to run until your limits are met as long as you're connected to the internet? Will you see any sort of message in terminal letting you know it's complete? Thanks

Yeah fot each interaction it prints out some details and at the end it will print out a summary of all the actions.

Thanks. I'll give it a go and see what happens

Ok, I'm stuck it appears.

Trying to install Selenium with sudo pip install selenium gives me:

error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages': Operation not permitted

In addition to that when I try to run the quickstart.py file, I get:

No module named clarifai.client

Inside of my quickstart file I set .set_use_clarifai(enabled=False) \ which thought meant don't use Clarifai? to be honest, I'm not real sure what Clarifai does?

Forget everything, just run the Mac script in the Scripts folder.
But before install Xcode command line utils.

Also in OSx you don't use pip, you use python setup.py install

You should read the main page before starting a new issue.

@vlntdds just did that. tried to run quicksetup.py again and still getting: ImportError: No module named clarifai.client

Clarifai is just for image recognition. E. g. if you would like to like all images which are tagged with #animal and are photos of cats, you can use Clarifai for this.

If you don’t need image recognition, just drop this line of code.

Here's my quickstart.py file. I'm not sure what I'm missing and why it keeps giving me the Clarifai error?

from instapy import InstaPy
import os

like_by_tags = ['#tag1', '#tag2']

InstaPy(username='', password='')\
    .login()\
    .set_do_follow(True, percentage=3) \
    .unfollow_users(amount=40) \
    .like_by_tags(like_by_tags, amount=50) \
    .set_upper_follower_count(limit = 250) \
    .end()

I would remove username and password from your comment as long as you can.

Regarding your error message: For me your script looks fine. I’m not sure what the second line (import os) is about – I don’t have it in my files and mine are working well.

@deronsizemore Removed your pw and username... Make sure to exclude them next time!

@tibor thanks. Yeah I'm an idiot leaving that password in there. I updated my credentials on my accounts. I'm not sure what the os import is. I didn't add it. It was there in the file when I downloaded the package.

@timgrossmann thanks for removing that. I can't believe I forgot it.

@tibor @deronsizemore Thanks for pointing out, removed the import os.
This was abandoned code because we had os.getenv() in there as username and password 😉

quoting @vlntdds:

Forget everything, just run the Mac script in the Scripts folder.

But there isn't a mac script in the scripts directory...

@shellscape You are correct, you can use the linux.sh script by typing sudo then drawing that file to the terminal window.

@shellscape

But there isn't a mac script in the scripts directory...

It was merged into the linux script so like @littleswany said, just run that. Also, I don't think you need to type sudo to run it. However, part of it does use sudo so you will need to enter your password halfway through the script.

@shellscape You probably have to do a git pull inside the InstaPy directory to get the newest version of IntsaPy

@timgrossmann Even I'm getting the following error on doing python quickstart.py:

Traceback (most recent call last):
  File "quickstart.py", line 2, in <module>
    from instapy import InstaPy
  File "/Users/dakshshah/Documents/Work/Git-Works/InstaPy/instapy/__init__.py", line 1, in <module>
    from .instapy import InstaPy
  File "/Users/dakshshah/Documents/Work/Git-Works/InstaPy/instapy/instapy.py", line 10, in <module>
    from .clarifai_util import check_image
  File "/Users/dakshshah/Documents/Work/Git-Works/InstaPy/instapy/clarifai_util.py", line 3, in <module>
    from clarifai.client import ClarifaiApi
ImportError: No module named clarifai.client

Any ideas why? If I comment out the line from .clarifai_util import check_image, everything seems to be working fine. Although, I wouldn't be able to utilize Clarifai.

@dakshshah96 please do a pip list and make sure to find clarifai in the printed list...

Or simply do another install with pip install clarifai or pip3.<your_version> install clarifai

@dakshshah96 Also, make sure to use the search, since this definitely has been asked before...

Anyone know why my code from https://github.com/timgrossmann/InstaPy/issues/198#issuecomment-296811000 isn't working and it's still giving me the error regarding clarifai? I don't think any of my code should even been trying to use Clarifai.

@deronsizemore Link is dead...

Sorry, not sure why the link is dead, but it's a comment from earlier in this thread.

https://github.com/timgrossmann/InstaPy/issues/198#issuecomment-296811000

@deronsizemore Clarifai is loaded if you use it or not... If you don't want it to be loaded you have to remove the code which has to do with clarifai. You could remove the import statement in instapy.pyfirst and then see what lines have to be deleted for InstaPy to start up again.

But clarifai really shouldn't be a/the problem... Try googling for the error and again installing clarifai as a dependency

Does this still persist? @deronsizemore

@timgrossmann @sunnypatel165

Sorry for the delay, guys. I got the script to run by commenting out from .clarifai_util import check_image

edit because I answered a couple of my original questions

One thing I was curious about (and I can submit a new question if needed since it's not relevant to the original question): when you've got things configured to follow accounts (set_do_follow), where does it find these accounts to follow?

Thanks again

AFAIK, it still uses the images from like_by_tags.
So if you say like_by_tags('#cat'), it will find all images of a cat and then based on the percentage parameter of do_follow, it will follow every nth user.
I maybe wrong though.

Thanks @sunnypatel165. It seems like though that the percentage parameter isn't following every nth user according to this comment: https://github.com/timgrossmann/InstaPy/issues/247#issuecomment-301075694

The docs say "every 10th user" for percentage=10 but then that comment above mentions it's a percentage? I'm confused on that.

@deronsizemore I think @timgrossmann updated the doc. It should be clear to all of us now! 👍 😃

Thanks

Hi guys,
first of all sorry for the late question. I just stepped on instapy. I have some issues.
I already installed the requirements und the setups but it still won't work. When I try to install request by its own its throwing an exception.
thats what I get when I wanna start QuickStart.py

Traceback (most recent call last):
File "quickstart.py", line 7, in
from instapy import InstaPy
File "/Users/anasmacpro/Repository/IntelliJ/InstaPy/instapy/__init__.py", line 2, in
from .instapy import InstaPy
File "/Users/anasmacpro/Repository/IntelliJ/InstaPy/instapy/instapy.py", line 20, in
import requests

hope you can help.
thx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CodeMaster1 picture CodeMaster1  ·  3Comments

rahulkapoor90 picture rahulkapoor90  ·  3Comments

Naramsim picture Naramsim  ·  3Comments

converge picture converge  ·  3Comments

drcyber975 picture drcyber975  ·  3Comments