Windows 10
PyCharm CE
Python 3.6
My chrome driver is located in C:\users\rache\desktop\instapy-master\assets
When I try and run my script I get an error, I can run this script fine on my mac but I would like to leave it up to run permanently on my windows laptop.
Below is where the code with error is. Also for some reason, the 'U' in users keeps changing colors, I don't know if that matters. (I am new to this)
self.browser = webdriver.Chrome('C:\Users\rache\Desktop\instapy-master\assets', chrome_options=chrome_options)
I have everything else set up, such as login, comments, follows, and likes. Below is the error I receive when trying to run this code. I have tried linking the code to '.\assets\chromedriver like the code originally said when first downloaded. but that didn't work either.
**C:\Users\rache\AppData\Local\Programs\Python\Python36-32\python.exe C:/Users/rache/Desktop/InstaPy-master/quickstart.py
Traceback (most recent call last):
File "C:\Users\rache\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 64, in start
stdout=self.log_file, stderr=self.log_file)
File "C:\Users\rache\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\rache\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/rache/Desktop/InstaPy-master/quickstart.py", line 14, in
InstaPy(username='username', password='password')\
File "C:\Users\rache\Desktop\InstaPy-master\instapy\instapy.py", line 37, in __init__
self.browser = webdriver.Chrome('/assets/chromedriver', chrome_options=chrome_options)
File "C:\Users\rache\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__
self.service.start()
File "C:\Users\rache\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
Exception ignored in:
Traceback (most recent call last):
File "C:\Users\rache\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 163, in __del__
self.stop()
File "C:\Users\rache\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 135, in stop
if self.process is None:
AttributeError: 'Service' object has no attribute 'process'
Process finished with exit code 1**
@brodydrey2296 Did you put it in the /assets folder ?
yes
On Thu, May 18, 2017 at 1:56 PM, Tim Großmann notifications@github.com
wrote:
@brodydrey2296 https://github.com/brodydrey2296 Did you put it in the
/assets folder ?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/timgrossmann/InstaPy/issues/262#issuecomment-302490545,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUHTvcJR2nz_2zPBZox4u3RsyG0QFbt_ks5r7IZCgaJpZM4NfVSI
.
@brodydrey2296 I've got something similar with Scrapy and Selenium. Put your selenium file to the same folder as your *.py file and change code to self.browser = webdriver.Chrome()
I fixed the issue, I was setting the chrome driver directory wrong... Sorry
about the inconvenience.
On Tue, May 23, 2017 at 4:47 PM, Mac notifications@github.com wrote:
@brodydrey2296 https://github.com/brodydrey2296 I've got something
similar with Scrapy and Selenium. Put your selenium file to the same folder
as your *.py file and change code to self.browser = webdriver.Chrome()—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/timgrossmann/InstaPy/issues/262#issuecomment-303527122,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUHTvekcd6dzibXIQ-SJcyW1C-4dcFMZks5r80XEgaJpZM4NfVSI
.
How did you set the chrome driver wrong???
@mcevadov we learn from mistakes..
No I meant, what did he do wrong because I had the same issue and didn't know how to set the driver directory wrong. But my problem has been solved! (:
@mcevadov that's great :)
Actually now that I want to edit my parameters I've broken it again. I am attempting to follow x amount of people and then like some photos and then unfollow y amount of people.
from instapy import InstaPy
import os
session = InstaPy(username='', password='', page_delay=27, nogui=True)
session.login()
accs = []
session.follow_by_list(accs, times=1)
session.unfollow_users(amount=10, onlyInstapyFollowed = True, onlyInstapyMethod = 'FIFO', sleep_delay=60 )
session.end()
I realize I have two InstaPy folders, one in downloads and one in GitHub. I imagine I should use the one on GitHub? When I do I receive this:
Traceback (most recent call last):
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\site-packages\easyprocess\__init__.py", line 225, in start
env=self.env,
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\site-packages\easyprocess\__init__.py", line 178, in check_installed
self.call()
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\site-packages\easyprocess\__init__.py", line 194, in call
self.start().wait(timeout=timeout)
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\site-packages\easyprocess\__init__.py", line 230, in start
raise EasyProcessError(self, 'start error')
easyprocess.EasyProcessError: start error <EasyProcess cmd_param=['Xvfb', '-help'] cmd=['Xvfb', '-help'] oserror=[WinError 2] The system cannot find the file specified return_code=None stdout="None" stderr="None" timeout_happened=False>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "quickstart.py", line 3, in <module>
session = InstaPy(username='', password='!1', page_delay=27, nogui=True)
File "C:\Users\cevad\Documents\GitHub\InstaPy\instapy\instapy.py", line 56, in __init__
self.display = Display(visible=0, size=(800, 600))
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\site-packages\pyvirtualdisplay\display.py", line 34, in __init__
self._obj = self.display_class(
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\site-packages\pyvirtualdisplay\display.py", line 52, in display_class
cls.check_installed()
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\site-packages\pyvirtualdisplay\xvfb.py", line 38, in check_installed
ubuntu_package=PACKAGE).check_installed()
File "C:\Users\cevad\AppData\Local\Programs\Python\Python36\lib\site-packages\easyprocess\__init__.py", line 180, in check_installed
raise EasyProcessCheckInstalledError(self)
easyprocess.EasyProcessCheckInstalledError: cmd=['Xvfb', '-help']
OSError=[WinError 2] The system cannot find the file specified
Program install error!
Of course I am going to continue digging to find an answer myself but my research again brought me back to this thread as being the most similar, so perhaps some of you are familiar with and can help correct me.
Thank you in advanced!
@mcevadov try removing nogui=True
Most helpful comment
No I meant, what did he do wrong because I had the same issue and didn't know how to set the driver directory wrong. But my problem has been solved! (: