markdrago / pgsanity

Check syntax of postgresql sql files
MIT License
316 stars 28 forks source link

No module named 'sqlprep' #6

Closed lino closed 10 years ago

lino commented 10 years ago

When installing pgsanity either from github or using pip, I get the following error when running it:

Traceback (most recent call last): File "/usr/bin/pgsanity", line 9, in load_entry_point('pgsanity==0.2.5', 'console_scripts', 'pgsanity')() File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 2363, in load_entry_point return ep.load() File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 2088, in load entry = import(self.module_name, globals(),globals(), ['name']) File "/usr/lib/python3.4/site-packages/pgsanity/pgsanity.py", line 9, in import sqlprep ImportError: No module named 'sqlprep'

I'm running Arch Linux and I have found out that the problem disappears when I manually call the script with python2. However this isn't very usable, at least for someone new to python.

markdrago commented 10 years ago

Yeah - this is a python 3 issue. I just pushed an updated pgsanity to both github and pypi with support for both python2 and python3. All unit tests pass and some manual smoke tests indicate that things are on the up-and-up. I'm also on arch linux and have been seeing this problem for a while. I've just been manually running pgsanity with 2.x, but you're right, that's bogus. Thanks for calling me out on this one. :)

Please reopen this ticket or create another one if you are still having problems.