Instapy: Unable to open database file

Created on 21 May 2018  路  7Comments  路  Source: timgrossmann/InstaPy

I don't know why I get that error. Any idea on how to fix it ?

C:\Users\Administrator\Desktop\InstaPy-master\examples>python example1.py
[0521/063714.803:ERROR:gpu_process_transport_factory.cc(1007)] Lost UI shared context.

DevTools listening on ws://127.0.0.1:12863/devtools/browser/5136c527-78cd-4493-984d-7943cce2d319
INFO [2018-05-21 06:37:16] [X]  Session started - 2018-05-21 06:37:16
WARNING [2018-05-21 06:37:16] [X]  Sorry, Record Activity is not working on Windows. We're working to fix this soon!
Traceback (most recent call last):
  File "example1.py", line 9, in <module>
    session.login()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\instagram_py-0.0.1-py3.6.egg\instapy\instapy.py", line 320, in login
    self.bypass_suspicious_attempt):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\instagram_py-0.0.1-py3.6.egg\instapy\login_util.py", line 100, in login_user
    update_activity()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\instagram_py-0.0.1-py3.6.egg\instapy\util.py", line 132, in update_activity
    conn = sqlite3.connect(Settings.database_location)
sqlite3.OperationalError: unable to open database file
wontfix

Most helpful comment

I was having the same problem when I installed with pip in virtualenv. Step 1. solved my problem. I had to add a db directory to /venv/lib/python3.6/site-packages/ then I downloaded instapy.db from the repo and added it to the db directory. Thanks for the answer @uluQulu!

All 7 comments

Hi @Raziel15
1. Is your database file (instapy.db) in db folder?
2. Do you use a custom database location by instantiating Settings class?

Settings.database_location = '/path/to/instapy.db'

_if yes, make sure locations are correct_
3. Do you have write access to the database file (instapy.db) and the directory containing it?
4. If there is no problem with the above steps, then re-download a fresh new instapy.db file from main repo and put it in db folder.

Cheers!

@jseps
Did you manage to solve your problem?
If not, I don't see the answers to my question in above comment.

Also, how did you install Instapy? (_e.g. from git or cloned to GitHub Desktop or installed from pip or downloaded ZIP_)
_By chance, if you have installed from pip, give a try to the fresh-new fix at #2080 by
@jaybocc2_

Cheers xD

@uluQulu
I did -- long story, but I somehow had 3 settings.py files relating to Instapy, and was editing the wrong ones. I cloned Instapy. Thank you!

Gald that it works @jseps
It's epic :D
BTW cloning to GitHub Desktop and using its amazing user interface is the best choice to having a clean folder structure and ease the process of getting new updates from repo.

I also use it most of time and only sometimes need git.

I was having the same problem when I installed with pip in virtualenv. Step 1. solved my problem. I had to add a db directory to /venv/lib/python3.6/site-packages/ then I downloaded instapy.db from the repo and added it to the db directory. Thanks for the answer @uluQulu!

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thisishotdog picture thisishotdog  路  3Comments

ingorichter picture ingorichter  路  3Comments

converge picture converge  路  3Comments

seuraltimez picture seuraltimez  路  3Comments

harrypython picture harrypython  路  3Comments