Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

sqlite3.OperationalError #4

Closed
alicenychto opened this issue Sep 10, 2016 · 8 comments
Closed

sqlite3.OperationalError #4

alicenychto opened this issue Sep 10, 2016 · 8 comments

Comments

@alicenychto
Copy link

alice at nychto in ~ [23:48:18]
$ bgmi cal all
Traceback (most recent call last):
  File "/usr/local/bin/bgmi", line 9, in <module>
    load_entry_point('bgmi==0.4.6', 'console_scripts', 'bgmi')()
  File "/usr/local/lib/python3.5/site-packages/bgmi-0.4.6-py3.5.egg/bgmi/main.py", line 408, in setup
    init_db(DB_PATH)
  File "/usr/local/lib/python3.5/site-packages/bgmi-0.4.6-py3.5.egg/bgmi/main.py", line 395, in init_db
    conn = sqlite3.connect(db_path)
sqlite3.OperationalError: unable to open database file

用pip和pip3安装的结果都是无法运行……

@RicterZ
Copy link
Owner

RicterZ commented Sep 11, 2016

看起来好像是初始化database失败了…默认是在~/.bgmi 目录,你看一下是不是没有读写权限?
Alice Nychto notifications@github.com于2016年9月11日 周日上午5:52写道:

alice at nychto in ~ [23:48:18]
$ bgmi cal all
Traceback (most recent call last):
File "/usr/local/bin/bgmi", line 9, in
load_entry_point('bgmi==0.4.6', 'console_scripts', 'bgmi')()
File "/usr/local/lib/python3.5/site-packages/bgmi-0.4.6-py3.5.egg/bgmi/main.py", line 408, in setup
init_db(DB_PATH)
File "/usr/local/lib/python3.5/site-packages/bgmi-0.4.6-py3.5.egg/bgmi/main.py", line 395, in init_db
conn = sqlite3.connect(db_path)
sqlite3.OperationalError: unable to open database file

用pip和pip3安装的结果都是无法运行……


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#4, or mute the thread
https://github.com/notifications/unsubscribe-auth/AFCbx7nQ9y7D_ZAEnk8Mjs-TwWDrsfk_ks5qoya1gaJpZM4J51pq
.

@auzeonfung
Copy link

我也遇到了这个问题,一开始是提示 sqlite3.OperationalError: attempt to write a readonly database ,尝试进入 ~/.bgmi 更改权限,然后就变 sqlite3.OperationalError: unable to open database file
用root权限就解决了……
不知道是哪里姿势不对

@RicterZ
Copy link
Owner

RicterZ commented Sep 25, 2016

感觉很不科学...什么情况下的呢..
是不是sudo pip install bgmi的。。

@auzeonfung
Copy link

@RicterZ 嗯……我的是用root权限装的……

@RicterZ
Copy link
Owner

RicterZ commented Sep 25, 2016

@auzeonfung 我大概知道问题了..
sudo pip install bgmi 的话,HOME 还是你当前普通用户的路径,但是创建路径的时候就是 root 权限创建在你当前用户的 HOME 下的,所以你当前用户没权限写...

@RicterZ
Copy link
Owner

RicterZ commented Sep 25, 2016

这个 bug 待会儿修(x

@alicenychto
Copy link
Author

还真是…chmod 777 之后就可以用了(后知后觉

@RicterZ
Copy link
Owner

RicterZ commented Sep 27, 2016

6b97e44
fix 了这个问题

@RicterZ RicterZ closed this as completed Sep 27, 2016
RicterZ pushed a commit that referenced this issue Jan 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants