InstaPy / InstaPy

📷 Instagram Bot - Tool for automated Instagram interactions
GNU General Public License v3.0
16.84k stars 3.78k forks source link

Not being able to install instapy from scratch in a fresh instance. #3895

Closed octavius-1 closed 5 years ago

octavius-1 commented 5 years ago

I'm trying to get instapy's new pip way of working in a fresh server but everytime I try to execute a new instapy script, this error is shown:

 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Workspace in use: "/home/ubuntu/InstaPy"

 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
INFO [2019-02-04 23:54:43] [user]  Using built in instapy-chromedriver executable (version 2.44)
ERROR [2019-02-04 23:54:44] [user]  Message: Service /home/ubuntu/.local/lib/python3.6/site-packages/instapy_chromedriver/chromedriver_linux64 unexpectedly exited. Status code was: 127
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.6/site-packages/instapy/browser.py", line 123, in set_selenium_local_session
    chrome_options=chrome_options)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
    % (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /home/ubuntu/.local/lib/python3.6/site-packages/instapy_chromedriver/chromedriver_linux64 unexpectedly exited. Status code was: 127

Traceback (most recent call last):
  File "instabot.py", line 50, in <module>
    page_delay=info.page_delay
  File "/home/ubuntu/.local/lib/python3.6/site-packages/instapy/instapy.py", line 276, in __init__
    self.set_selenium_local_session()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/instapy/instapy.py", line 328, in set_selenium_local_session
    raise InstaPyError(err_msg)
instapy.exceptions.InstaPyError: ensure chromedriver is installed at /home/ubuntu/.local/lib/python3.6/site-packages/instapy_chromedriver/chromedriver_linux64

All the commands I ran right after I connected to the server for the first time are here:

    mkdir InstaPy
    sudo apt-get update
    sudo apt-get install python3
    sudo apt install python3-pip
    pip3 install instapy
    sudo apt-get install xvfb
    cd InstaPy/
   I COPIED EVERYTHING FROM ANOTHER INSTANCE USING SCP HERE
    ls
    python3 insta.py

Does anyone know how to fix this? I already tried previously by uninstalling and installing instapy again.

GreatTimeBand commented 5 years ago

see previous issue I opened...lots of people seem to be having problems with the new version. We need Tim to step in!!

mrrobotsca commented 5 years ago

same here on raspberry pi !! since the new upgrade , getting this error

mrrobotsca commented 5 years ago

@ishandutta2007 did your instruction , but still same . did you reinstall InstaPy after that ?

tE3m commented 5 years ago

The reason this happens on Raspberry is that it doesn't use the correct chromedriver. It automatically uses the one downloaded if there's none in the assets folder of the new workspace folder. So you either need to copy your chromedriver to the new workspace or set the workspace folder to your old InstaPy folder @mrrobotsca

tE3m commented 5 years ago

@octavius-1 did you set your workspace folder(

session.set_workspace(path=path/to/InstaPy/)

) to the folder you created with mkdir?

breuerfelix commented 5 years ago

@octavius-1 according to this post chromedriver needs some extra libraries on linux.

apt-get install -y libglib2.0-0=2.50.3-2 \
    libnss3=2:3.26.2-1.1+deb9u1 \
    libgconf-2-4=3.2.6-4+b1 \
    libfontconfig1=2.11.0-6.7+b1

I don't think that you need the exact version of each package so maybe try to got for this one:

apt-get install -y libglib2.0-0 \
    libnss3 \
    libgconf-2-4 \
    libfontconfig1

Also if this does not work out, take the old chromedriver version you used before the update and put it inside your workspace folder. Then set the workspace like @TarekJ03 mentioned in his solution. This will work 100% while you should try the above solution if you don't wanna use an external chromedriver.

@octavius-1 Also, could you please tell us which chromedriver version you were using before the update ? So we can add this particular version to the instapy-chromedriver package. After that, I will explain how you can switch to this version with this one command!

Tr1pke commented 5 years ago

instapy.exceptions.InstaPyError: ensure chromedriver is installed at /home/steven/InstaPy/assets/chromedriver

it is there, i just downloaded the latest one and put it in there same error

breuerfelix commented 5 years ago

@Tr1pke windows or linux / Mac ?

what is the name of your chromedriver ? have you already tried using no chromedriver at all and using the built in chromedriver ?

Tr1pke commented 5 years ago

linux and yes

ERROR [2019-02-05 20:14:14] [steven.triathlon] Message: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.18.0-14-generic x86_64)

if i delete the chromedriver i get:

instapy.exceptions.InstaPyError: ensure chromedriver is installed at /home/steven/.local/lib/python3.6/site-packages/instapy_chromedriver/chromedriver_linux64

Requirement already satisfied: instapy-chromedriver==2.44 in /home/steven/.local/lib/python3.6/site-packages (from instapy) (2.44)

breuerfelix commented 5 years ago

could you print out an ls of /home/steven/.local/lib/python3.6/site-packages/instapy_chromedriver ?

I also have version 2.44 and in my instapy-chromedriver package there is a file named chromedriver_linux64

Tr1pke commented 5 years ago

chromedriver_linux64 chromedriver_mac64 chromedriver_win32.exe init.py pycache

potentowl commented 5 years ago

this is my error

sudo python3 quickstart.py

 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Workspace in use: "/home/ubuntu/InstaPy"
ERROR [2019-02-05 19:25:21] [instagramname]  Message: session not created: Chrome version must be between 71 and 75
  (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.15.0-1031-aws x86_64)
Traceback (most recent call last):
  File "/home/ubuntu/newbot5/instapy/browser.py", line 123, in set_selenium_local_session
    chrome_options=chrome_options)
  File "/usr/local/lib/python3.6/dist-packages/selenium-3.141.0-py3.6.egg/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
    desired_capabilities=desired_capabilities)
  File "/usr/local/lib/python3.6/dist-packages/selenium-3.141.0-py3.6.egg/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.6/dist-packages/selenium-3.141.0-py3.6.egg/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.6/dist-packages/selenium-3.141.0-py3.6.egg/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.6/dist-packages/selenium-3.141.0-py3.6.egg/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome version must be between 71 and 75
  (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.15.0-1031-aws x86_64)

Traceback (most recent call last):
  File "quickstart.py", line 18, in <module>
    headless_browser=True)
  File "/home/ubuntu/newbot5/instapy/instapy.py", line 276, in __init__
    self.set_selenium_local_session()
  File "/home/ubuntu/newbot5/instapy/instapy.py", line 328, in set_selenium_local_session
    raise InstaPyError(err_msg)
instapy.exceptions.InstaPyError: ensure chromedriver is installed at /home/ubuntu/InstaPy/assets/chromedriver
Tr1pke commented 5 years ago

its the same error as me ...

breuerfelix commented 5 years ago

@Tr1pke could you please do an ls -la in the same directory ?

@loopypanda (I can't tag you somehow) could you please do pip3 install instapy-chromedriver==2.46 and try again ?

@Tr1pke I thought you got a different error ? you got ERROR [2019-02-05 20:14:14] [steven.triathlon] Message: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.46.628388

right ? these are 2 different errors :)

potentowl commented 5 years ago

i fixed my error i think... troubleshoot the code and the first error is Message: session not created: Chrome version must be between 71 and 75

google-chrome --version
cd ~
wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install -y -f
sudo rm google-chrome-stable_current_amd64.deb

now it has this error

Traceback (most recent call last):
  File "quickstart.py", line 37, in <module>
    session.set_workspace(path=home/ubuntu/InstaPy)
AttributeError: 'InstaPy' object has no attribute 'set_workspace'
Tr1pke commented 5 years ago

drwxrwsr-x 3 steven staff 4,0K Feb 5 20:35 . drwxrwsrwx 6 root staff 4,0K Feb 5 20:35 .. -rwxrwxr-x 1 steven staff 12M Feb 5 20:35 chromedriver_linux64 -rwxrwxr-x 1 steven staff 15M Feb 5 20:35 chromedriver_mac64 -rwxrwxr-x 1 steven staff 8,3M Feb 5 20:35 chromedriver_win32.exe -rw-rw-r-- 1 steven staff 940 Feb 5 20:35 init.py drwxrwsr-x 2 steven staff 4,0K Feb 5 20:35 pycache

breuerfelix commented 5 years ago

@Tr1pke I got no clue why you get this error... this is out of my knowledge ! @uluQulu could you help out here ?

@loopypanda could you post your Quickstart file (without credentials of course) ?

Tr1pke commented 5 years ago

@Tr1pke I got no clue why you get this error... this is out of my knowledge ! @uluQulu could you help out here ?

@loopypanda could you post your Quickstart file (without credentials of course) ?

ill try a fresh install of ubuntu

jeremycjang commented 5 years ago

@scriptworld-git I just pulled the latest updates and am getting the following error that seem related to your latest code additions to the master branch :

ImportError: No module named instapy_chromedriver

I was unable to find any files that currently live in the master branch named "Instapy_chromedriver" and also attempted ``pip3 install instapy-chromedriver==2.46```, but am still observing the same error.

I have one of the original Raspberry Pi installations of the program that used wget`` instead ofpip` to get it up and have been updating with git pull origin master. Do you know how I might be able to remediate this?

Thank you!

breuerfelix commented 5 years ago

@jeremycjang do you know which chromedriver version you used before the update ?

there are 2 attempts for this.

Tr1pke commented 5 years ago

steven@srv-purple:$ pip install instaspy Collecting instaspy Could not find a version that satisfies the requirement instaspy (from versions: ) No matching distribution found for instaspy steven@srv-purple:~$

breuerfelix commented 5 years ago

@Tr1pke are executing with python3 so make sure to use pip3 install instapy and not just pip install instapy.

you already did that ? also if you use virtual environments, make sure do install instapy in the correct one

also please stick to this issue. the other one got nothing to do with the chromedriver or the package.... its about database problems

BTW its called instapy not instaspy

Tr1pke commented 5 years ago

@Tr1pke are executing with python3 so make sure to use pip3 install instapy and not just pip install instapy.

you already did that ? also if you use virtual environments, make sure do install instapy in the correct one

also please stick to this issue. the other one got nothing to do with the chromedriver or the package.... its about database problems

BTW its called instapy not instaspy

i did instapy i did it a couple of time ontly the last one is wrong It downloads instapy but i can't execute my script

steven@srv-purple:~$ python3 steven.py File "steven.py", line 5 set_workspace(path=/home/steven/Instapy) ^ SyntaxError: invalid syntax steven@srv-purple:~$

i will do a git install

breuerfelix commented 5 years ago

@Tr1pke there is a syntax error ! that's totally not a package fault.... show me your Steven.py

Tr1pke commented 5 years ago

@Tr1pke there is a syntax error ! that's totally not a package fault.... show me your Steven.py

from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace

set_workspace(path=/home/steven/Instapy)

insta_username = 'xx'
insta_password = 'xx'

session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True)

with smart_run(session):
    session.set_relationship_bounds(enabled=True,
                                     delimit_by_numbers=True,
                                      max_followers=10000,
                                      min_followers=50,
                                      min_following=50)

    session.set_do_follow(enabled=True, percentage=100, times=2)
    session.set_skip_users(skip_private=False, private_percentage=0)
    session.set_dont_include(["friend1", "friend2", "friend3"])
    session.set_dont_like(["pizza", "#porn"])
    session.follow_user_followers(['follow','follow','follow','follow'], amount=40, randomize=True, interact=False)

I use this steven.py already for half a year. i only added - set_workspace(path=/home/steven/Instapy)

breuerfelix commented 5 years ago

(path='/home/steven/instapy')

please use quotes here since its a string. try that fix

Tr1pke commented 5 years ago

(path='/home/steven/instapy')

please use quotes here since its a string. try that fix

raceback (most recent call last): File "steven.py", line 1, in from instapy import InstaPy ModuleNotFoundError: No module named 'instapy'

breuerfelix commented 5 years ago

could you please chat me at discord ? my nickname is scriptworld there. I wanna see this on team viewer it must be a trivial error

Tr1pke commented 5 years ago

i don't have discord

breuerfelix commented 5 years ago

@Tr1pke had permission errors when installing instapy.

pip3 install --user instapy solved this issue.
reading read text on the command line helps sometimes :)) (it was mentioned there)

now we just need to solve @octavius-1 problem :)

Tr1pke commented 5 years ago

@Tr1pke had permission errors when installing instapy.

pip3 install --user instapy solved this issue. reading read text on the command line helps sometimes :)) (it was mentioned there)

now we just need to solve @octavius-1 problem :)T

Thank you so much !!!

jeremycjang commented 5 years ago

@scriptworld-git For Raspberry Pi users, I recall that only Chromedriver 2.33 works

Also, it appears multiple users are currently experiencing the same issue after the update Issue #3920

jeremycjang commented 5 years ago

@scriptworld-git Thank you for the mention of the workspace assets folder! I got it working by commenting out the import instapy_chromedriver line and C&Ping all the assets from the old assets folder that lives in the project folder (which I'm honestly not sure why the change to save it outside the project folder was needed?) to the new one. Cheers

tE3m commented 5 years ago

@jeremycjang the version for RPi users is v2.36. And moving the InstaPy folder wasn't needed. If you had looked into the new readme, you'd know that you can also set the workspace to be your old folder. But then you may not run scripts from inside that folder, because it'd use instapy inside the InstaPy folder, not the pip module.

tE3m commented 5 years ago

@loopypanda have you fixed it? If not, you need to

from instapy inport set_workspace
jeremycjang commented 5 years ago

@TarekJ03 I tried setting the workspace first using the absolute path to my InstaPy project folder, but it didn't work.

miguelrodriguezpro commented 5 years ago

I'm trying to get instapy's new pip way of working in a fresh server but everytime I try to execute a new instapy script, this error is shown:

 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Workspace in use: "/home/ubuntu/InstaPy"

 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
INFO [2019-02-04 23:54:43] [user]  Using built in instapy-chromedriver executable (version 2.44)
ERROR [2019-02-04 23:54:44] [user]  Message: Service /home/ubuntu/.local/lib/python3.6/site-packages/instapy_chromedriver/chromedriver_linux64 unexpectedly exited. Status code was: 127
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.6/site-packages/instapy/browser.py", line 123, in set_selenium_local_session
    chrome_options=chrome_options)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
    % (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /home/ubuntu/.local/lib/python3.6/site-packages/instapy_chromedriver/chromedriver_linux64 unexpectedly exited. Status code was: 127

Traceback (most recent call last):
  File "instabot.py", line 50, in <module>
    page_delay=info.page_delay
  File "/home/ubuntu/.local/lib/python3.6/site-packages/instapy/instapy.py", line 276, in __init__
    self.set_selenium_local_session()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/instapy/instapy.py", line 328, in set_selenium_local_session
    raise InstaPyError(err_msg)
instapy.exceptions.InstaPyError: ensure chromedriver is installed at /home/ubuntu/.local/lib/python3.6/site-packages/instapy_chromedriver/chromedriver_linux64

All the commands I ran right after I connected to the server for the first time are here:

    mkdir InstaPy
    sudo apt-get update
    sudo apt-get install python3
    sudo apt install python3-pip
    pip3 install instapy
    sudo apt-get install xvfb
    cd InstaPy/
   I COPIED EVERYTHING FROM ANOTHER INSTANCE USING SCP HERE
    ls
    python3 insta.py

Does anyone know how to fix this? I already tried previously by uninstalling and installing instapy again.

For me it worked uploading the new folder (dont know if that made a difference though), and for sure this:

sudo apt-get install chromium-browser chromium-chromedriver

make sure it is installed!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this problem still occurs, please open a new issue

fredcosta77 commented 5 years ago

I also have a similar problem: When running the quickstart.py here is what I get:

starting instapy with quickstart

Traceback (most recent call last): File "../quickstart.py", line 3, in from instapy import InstaPy File "C:\Users\Frederico Costa\Anaconda3\lib\site-packages\instapy__init.py", line 3, in from .instapy import InstaPy File "C:\Users\Frederico Costa\Anaconda3\lib\site-packages\instapy\instapy.py", line 23, in from .comment_util import comment_image File "C:\Users\Frederico Costa\Anaconda3\lib\site-packages\instapy\comment_util.py", line 8, in from .util import update_activity File "C:\Users\Frederico Costa\Anaconda3\lib\site-packages\instapy\util.py", line 19, in import sqlite3 File "C:\Users\Frederico Costa\Anaconda3\lib\sqlite3\init__.py", line 23, in from sqlite3.dbapi2 import File "C:\Users\Frederico Costa\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in from _sqlite3 import ImportError: DLL load failed: Impossível localizar o módulo especificado. Press any key to continue . . .

breuerfelix commented 5 years ago

@fredcosta77 you should open a new issue for that since its a totally different one :)

this one is related to SQLite 3