Search code examples
pythoninstagramgeckodriver

What is the cause permission error in instapy?


error caused when the session starts, It worked in the beginning but it broke its self after a while.

Traceback (most recent call last):
  File "C:\Users\Desktop\InstaPy-master\quickstart.py", line 12, in <module>
    session = InstaPy( username=insta_username, password=insta_password)
  File "C:\Users\Desktop\InstaPy-master\instapy\instapy.py", line 319, in __init__
    self.logger,
  File "C:\Users\Desktop\InstaPy-master\instapy\browser.py", line 114, in set_selenium_local_session
    driver_path = geckodriver_path or get_geckodriver()
  File "C:\Users\Desktop\InstaPy-master\instapy\browser.py", line 36, in get_geckodriver
    bin_path, sym_path = gdd.download_and_install()
  File "C:\Users\AppData\Local\Programs\Python\Python37\lib\site-packages\webdriverdownloader\webdriverdownloader.py", line 196, in download_and_install
    shutil.copy2(src_file, dest_file)
  File "C:\Users\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 263, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Users\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\dalto\\InstaPy\\assets\\geckodriver.exe'

Solution

  • This error is coming because we try to open file and it is already in use, so simple option is kill the task geckodriver.exe from task manager. This will resolve the problem because mine is resolved.