Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execute fail on colab #35

Open
momortk opened this issue Jun 1, 2022 · 1 comment
Open

execute fail on colab #35

momortk opened this issue Jun 1, 2022 · 1 comment

Comments

@momortk
Copy link

momortk commented Jun 1, 2022

Hi,
I try to use below code on colab:

try:
import zipcodetw
except ImportError:
!pip install zipcodetw
import zipcodetw

zipcodetw.find('臺北市信義區市府路1號')

but colab shows "util.py line 363, OperationalError: no such table: precise"
Is any way to work on colab?
Thanks.

more debug message:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting zipcodetw
Downloading zipcodetw-0.6.8.tar.gz (592 kB)
|████████████████████████████████| 592 kB 7.7 MB/s
Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from zipcodetw) (1.15.0)
Collecting unicodecsv
Downloading unicodecsv-0.14.1.tar.gz (10 kB)
Building wheels for collected packages: zipcodetw, unicodecsv
Building wheel for zipcodetw (setup.py) ... done
Created wheel for zipcodetw: filename=zipcodetw-0.6.8-py3-none-any.whl size=610897 sha256=8e8739c0bd79c942aaf817780ebf89acc61ad3d7a90bcd0c81cf3bd47b41cbb7
Stored in directory: /root/.cache/pip/wheels/37/03/5b/638651b1773a38a94b3a63284267f5bf248af9954dc617f8cd
Building wheel for unicodecsv (setup.py) ... done
Created wheel for unicodecsv: filename=unicodecsv-0.14.1-py3-none-any.whl size=10768 sha256=84c4ba5866616b0e6f7d2821a0cfce99c4dcd26e8a3a178974cdcf096aeb943d
Stored in directory: /root/.cache/pip/wheels/1a/f4/8a/a5024fb77b32ed369e5c409081e5f00fbe3b92fdad653f6e69
Successfully built zipcodetw unicodecsv
Installing collected packages: unicodecsv, zipcodetw
Successfully installed unicodecsv-0.14.1 zipcodetw-0.6.8

OperationalError Traceback (most recent call last)
in ()
5 import zipcodetw
6
----> 7 zipcodetw.find('臺北市信義區市府路1號')

2 frames
/usr/local/lib/python3.7/dist-packages/zipcodetw/util.py in get_rule_str_zipcode_pairs(self, addr_str)
361 from precise
362 where addr_str = ?;
--> 363 ''', (addr_str,))
364
365 return self.cur.fetchall()

OperationalError: no such table: precise

@hsuan1117
Copy link

I just build the index and it fixes

python -m zipcodetw.builder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants