InstaPy / instapy-quickstart

💨 Simply get InstaPy up and running in minutes.
GNU General Public License v3.0
764 stars 795 forks source link

can not import name "smart run" #4

Closed newcodemarc closed 5 years ago

newcodemarc commented 5 years ago

I used the usual instapy before and it worked well. Now I wanted to try out the quickstart version and after running the quickstart script I get this error starting instapy with quickstart. Installed it on Windows

Traceback (most recent call last): File "../quickstart.py", line 4, in from instapy import smart_run ImportError: cannot import name 'smart_run' Drücken Sie eine beliebige Taste . . .

does annyone know what is wrong with it?

Zettt commented 5 years ago

Same issue, but on a Mac. I think the pip needs to be updated and re-released.

timgrossmann commented 5 years ago

Have you guys installed and updated InstaPy? Try hitting the update script once or doing pip install -U instapy

Zettt commented 5 years ago

Have you guys installed and updated InstaPy? Try hitting the update script once or doing pip install -U instapy

Requirement already up-to-date: instapy in /usr/local/lib/python2.7/site-packages (0.1.3

timgrossmann commented 5 years ago

Still problem with smart_run ? How does your quickstart file look like? Have you used the quickstart file from this repository?

Also, where does your quickstart file reside? Is it still inside this repository?

Zettt commented 5 years ago

@timgrossmann

I've tried saving this example on the Desktop, so it's not in any repository anymore but I still get the smart_run error.

  File "test.py", line 3, in <module>
    from instapy import smart_run
ImportError: cannot import name smart_run

My quick start file look like this:

# imports
from instapy import InstaPy
from instapy import smart_run

# login credentials
insta_username = ''
insta_password = ''

# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=False,
                  multi_logs=True)

with smart_run(session):
    """ Activity flow """
    # general settings
    session.set_relationship_bounds(enabled=True, potency_ratio=-1.21, delimit_by_numbers=True,
                                    max_followers=4590, max_following=5555, min_followers=45, min_following=77)

    session.set_dont_include(['someone'])
    session.set_smart_hashtags(['graffiti', 'streetart', 'art', 'mural'], limit=5, sort='top', log_tags=True)
    session.like_by_tags(amount=10, use_smart_hashtags=True)

    session.like_by_tags(['instagraffiti', 'sprayart'], amount=5, interact=True)

    session.like_by_feed(amount=9, randomize=True, unfollow=False, interact=False)
timgrossmann commented 5 years ago

@newcodemarc That is super weird 🤔

Can you please do:

pip uninstall instapy

and then run the install script in the installation folder again and paste the full output of that installation script in here? 😊

Zettt commented 5 years ago

@timgrossmann Here's the pastebin. https://pastebin.com/N57hPR2n

timgrossmann commented 5 years ago

@Zettt Install Python3 please

And paste the output of pip list|grep instapy, please

Really weird, too that you get that error upon executing the update command script. Same error when actually double clicking it?

newcodemarc commented 5 years ago

I´ll try it tonight. My solution was to just go back to the old version with the old installation and then update it there instead of doing the quickstart installation.

Zettt commented 5 years ago

@timgrossmann I tried it, and it worked with Python 3. Thank you.

@newcodemarc You can have Python 2 and 3 installed. For me it was simply pip3 install -U instapy. Then run python3 quickstart.py.

But I also had to move the workspace folder too. It crashed a couple of times as well, which is likely an unrelated issue (wrong indentation in Python file, Little Snitch blocking Python, etc.)