gilesknap / gphotos-sync

Google Photos and Albums backup with Google Photos Library API
Apache License 2.0
1.97k stars 161 forks source link

FreeBSD error "ModuleNotFoundError: No module named '_sqlite3'" #393

Closed irgipaulius closed 1 year ago

irgipaulius commented 1 year ago

system:

issue command:

gphotos-sync --version

as well as:

gphotos-sync /media/gphotos --skip-files --skip-albums --skip-index

expected result:

some version code

or

something else, really

actual result:

(venv) root@myjail:~ # gphotos-sync --version
Traceback (most recent call last):
  File "/root/gphotos/venv/bin/gphotos-sync", line 5, in <module>
    from gphotos_sync.Main import main
  File "/root/gphotos/venv/lib/python3.9/site-packages/gphotos_sync/Main.py", line 13, in <module>
    from gphotos_sync import Utils, __version__
  File "/root/gphotos/venv/lib/python3.9/site-packages/gphotos_sync/Utils.py", line 6, in <module>
    from sqlite3 import Timestamp
  File "/usr/local/lib/python3.9/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.9/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

description

I tried installing gphotos-sync from pkg, as well as from the git repository. same issue.

How do I install sqlite? I don't understand how python packages are built, so please be specific, or provide links to resources. pretty please <3

thanks!

gilesknap commented 1 year ago

Hmmm.

I'm not sure what is happening here but have zero experience of FreeBSD.

Normally pip will pull all the dependencies you need.

Please could you post all the output when you run.

pip install gphotos-sync
gilesknap commented 1 year ago

Oh and then the output from

pip freeze
willsheppard commented 1 year ago

I have the same error on Ubuntu 22.04.1 LTS.

I installed python using asdf:

$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2
$ asdf plugin add python
$ asdf install python latest
$ asdf global python latest
$ asdf local python latest
$ asdf shell python latest

$ which python
/home/will/.asdf/installs/python/3.11.0/bin/python
$ python --version
Python 3.11.0

$ which python3
/home/will/.asdf/installs/python/3.11.0/bin/python3
$ python3 --version
Python 3.11.0

Installed gphotos-sync according to the instructions:

$ python3 -m pip install gphotos-sync
Collecting gphotos-sync
  Downloading gphotos_sync-3.0.3-py3-none-any.whl (53 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.5/53.5 kB 1.4 MB/s eta 0:00:00
Collecting attrs
  Downloading attrs-22.1.0-py2.py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 kB 3.7 MB/s eta 0:00:00
Collecting exif
  Downloading exif-1.4.0-py3-none-any.whl (30 kB)
Collecting appdirs
  Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting requests-oauthlib
  Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Collecting pyyaml>=4.2b1
  Downloading PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.9/757.9 kB 4.5 MB/s eta 0:00:00
Collecting types-PyYAML
  Downloading types_PyYAML-6.0.12.2-py3-none-any.whl (14 kB)
Collecting psutil
  Downloading psutil-5.9.4-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 280.2/280.2 kB 4.4 MB/s eta 0:00:00
Collecting google-auth-oauthlib
  Downloading google_auth_oauthlib-0.7.1-py2.py3-none-any.whl (19 kB)
Collecting types-requests
  Downloading types_requests-2.28.11.5-py3-none-any.whl (14 kB)
Collecting plum-py<2.0.0,>=0.5.0
  Downloading plum_py-0.8.5-py3-none-any.whl (93 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 93.9/93.9 kB 4.2 MB/s eta 0:00:00
Collecting google-auth>=2.14.0
  Downloading google_auth-2.15.0-py2.py3-none-any.whl (177 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 177.0/177.0 kB 4.3 MB/s eta 0:00:00
Collecting oauthlib>=3.0.0
  Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.7/151.7 kB 3.7 MB/s eta 0:00:00
Collecting requests>=2.0.0
  Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting types-urllib3<1.27
  Downloading types_urllib3-1.26.25.4-py3-none-any.whl (14 kB)
Collecting cachetools<6.0,>=2.0.0
  Downloading cachetools-5.2.0-py3-none-any.whl (9.3 kB)
Collecting pyasn1-modules>=0.2.1
  Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 2.0 MB/s eta 0:00:00
Collecting six>=1.9.0
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting rsa<5,>=3.1.4
  Downloading rsa-4.9-py3-none-any.whl (34 kB)
Collecting charset-normalizer<3,>=2
  Using cached charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 727.4 kB/s eta 0:00:00
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.13-py2.py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 kB 1.5 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2022.9.24-py3-none-any.whl (161 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.1/161.1 kB 2.3 MB/s eta 0:00:00
Collecting pyasn1<0.5.0,>=0.4.6
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB 2.9 MB/s eta 0:00:00
Installing collected packages: types-urllib3, types-PyYAML, pyasn1, appdirs, urllib3, types-requests, six, rsa, pyyaml, pyasn1-modules, psutil, plum-py, oauthlib, idna, charset-normalizer, certifi, cachetools, attrs, requests, google-auth, exif, requests-oauthlib, google-auth-oauthlib, gphotos-sync
Successfully installed appdirs-1.4.4 attrs-22.1.0 cachetools-5.2.0 certifi-2022.9.24 charset-normalizer-2.1.1 exif-1.4.0 google-auth-2.15.0 google-auth-oauthlib-0.7.1 gphotos-sync-3.0.3 idna-3.4 oauthlib-3.2.2 plum-py-0.8.5 psutil-5.9.4 pyasn1-0.4.8 pyasn1-modules-0.2.8 pyyaml-6.0 requests-2.28.1 requests-oauthlib-1.3.1 rsa-4.9 six-1.16.0 types-PyYAML-6.0.12.2 types-requests-2.28.11.5 types-urllib3-1.26.25.4 urllib3-1.26.13

[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: pip3 install --upgrade pip

It wasn't put it in my path:

$ gphotos-sync --version
gphotos-sync: command not found

But I found it:

$ find ~/.asdf/ -name gphotos-sync
/home/will/.asdf/installs/python/3.11.0/bin/gphotos-sync

Got the same error as the OP:

$ /home/will/.asdf/installs/python/3.11.0/bin/gphotos-sync
Traceback (most recent call last):
  File "/home/will/.asdf/installs/python/3.11.0/bin/gphotos-sync", line 5, in <module>
    from gphotos_sync.Main import main
  File "/home/will/.asdf/installs/python/3.11.0/lib/python3.11/site-packages/gphotos_sync/Main.py", line 13, in <module>
    from gphotos_sync import Utils, __version__
  File "/home/will/.asdf/installs/python/3.11.0/lib/python3.11/site-packages/gphotos_sync/Utils.py", line 6, in <module>
    from sqlite3 import Timestamp
  File "/home/will/.asdf/installs/python/3.11.0/lib/python3.11/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  File "/home/will/.asdf/installs/python/3.11.0/lib/python3.11/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

Pip freeze:

$ pip freeze
appdirs==1.4.4
attrs==22.1.0
cachetools==5.2.0
certifi==2022.9.24
charset-normalizer==2.1.1
exif==1.4.0
google-auth==2.15.0
google-auth-oauthlib==0.7.1
gphotos-sync==3.0.3
idna==3.4
oauthlib==3.2.2
plum-py==0.8.5
psutil==5.9.4
pyasn1==0.4.8
pyasn1-modules==0.2.8
PyYAML==6.0
requests==2.28.1
requests-oauthlib==1.3.1
rsa==4.9
six==1.16.0
types-PyYAML==6.0.12.2
types-requests==2.28.11.5
types-urllib3==1.26.25.4
urllib3==1.26.13

A bit more investigation:

$ python3 -m sqlite
/home/will/.asdf/installs/python/3.11.0/bin/python3: No module named sqlite
$ python3 -m sqlite3
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/will/.asdf/installs/python/3.11.0/lib/python3.11/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  File "/home/will/.asdf/installs/python/3.11.0/lib/python3.11/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
gilesknap commented 1 year ago

Sorry for very late reply. I'm going to say that as sqlite is not a pure python package you are out of luck on BSD. Closing as 'sorry we don't support BSD' But feel free to re-open if you think there is any hope.