Python: installing sqlparse module

The process was a little involved and required the installation of a few sub modules.  Here’s what I needed to get done to complete the entire process:

  1. URL: https://github.com/andialbrecht/sqlparse
  2. Download package & extract package
  3. Open command prompt
  4. Navigate to the package and execute setup.py install command

At this point I ran in to a problem where the system threw a hard error complaining that zip_safe flag not  being set:

zip_safe flag not set; analyzing archive contents...

The solution was to make a small addition to the setyp.py file that was extracted from the downloaded package. Here’s how it looks:

setup(
    name='sqlparse',
    version=VERSION,
    packages=packages,
    description='Non-validating SQL parser',
    author='Andi Albrecht',
    author_email='albrecht.andi@gmail.com',
    long_description=LONG_DESCRIPTION,
    license='BSD',
    url='https://github.com/andialbrecht/sqlparse',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.4',
        'Programming Language :: Python :: 2.5',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Topic :: Database',
        'Topic :: Software Development'
    ],
    zip_safe=False,
    scripts=['bin/sqlformat'],
    **kwargs
)

Leave a Reply

*

captcha *