zipcodetw icon indicating copy to clipboard operation
zipcodetw copied to clipboard

Fix build index problem in reinstallation

Open OftenLin opened this issue 5 years ago • 4 comments

As the error code while doing reinstallation(remove and install again):

Traceback (most recent call last):
  File "setup.py", line 52, in <module>
    cmdclass = {'install': zipcodetw_install},
  File "...\lib\site-packages\setuptools-40.8.0-py3.6.egg\setuptools\__init__.py", line 145, in setup
  File "...\appdata\local\programs\python\python36-32\Lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "...\appdata\local\programs\python\python36-32\Lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "...\appdata\local\programs\python\python36-32\Lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 14, in run
    zipcodetw.builder.build()
  File "...\zipcodetw\zipcodetw\builder.py", line 23, in build
    dir_.load_chp_csv(csv_f)
  File "...\zipcodetw\zipcodetw\util.py", line 317, in method_wrapper
    retval = method(self, *args, **kargs)
  File "...\zipcodetw\zipcodetw\util.py", line 335, in load_chp_csv
    self.create_tables()
  File "...\zipcodetw\zipcodetw\util.py", line 241, in create_tables
    ''')
sqlite3.OperationalError: table precise already exists

The code in setup.py: zipcodetw.builder.build() will cause the error above which need to [try expect] to let reinstallation can be successfully, thxs ~

OftenLin avatar Feb 17 '19 14:02 OftenLin

Hmmm ... I can install after uninstall or --force-reinstall normally. Maybe the issue got fixed?

moskytw avatar Aug 08 '21 08:08 moskytw

Hmmm ... I can install after uninstall or --force-reinstall normally. Maybe the issue got fixed?

Sounds like you were using pip and had an environment which doesnt replicate the problem.

Try using setup.py build followed by setup.py install in a clean environment.

Nothing has exception handling if the tables already exist.

jayvdb avatar Aug 08 '21 11:08 jayvdb

Could you kindly confirm the issue is same as https://github.com/moskytw/zipcodetw/issues/31?

moskytw avatar Sep 09 '21 14:09 moskytw

It is unrelated to #31

jayvdb avatar Sep 09 '21 18:09 jayvdb