miguelgrinberg / REST-auth

Example application for my RESTful Authentication with Flask article.
http://blog.miguelgrinberg.com/post/restful-authentication-with-flask
MIT License
921 stars 337 forks source link

ModuleNotFoundError "pysqllite2" #14

Closed ghost closed 5 years ago

ghost commented 5 years ago

unable to launch app, getting ModuleNotFoundError "pysqllite2" on db.create_all

miguelgrinberg commented 5 years ago

Did you compile Python yourself? You are missing stuff, such as sqlite3.

ghost commented 5 years ago

I did a pip on requirements.txt Was getting module not found for pysqlite2 rNow I removed all the versions from requirments.txt and did a pip again and it started working. Please, note I am using python 3.6 If the dependencies are for 2.7 then please add a line on the readme. By the way, the code is well explained.

miguelgrinberg commented 5 years ago

The dependencies work for 2.7 and 3.5+, they are all the same. You must have had something in your virtualenv that affected the sqlite module. I first thought you may have a Python compiled w/o sqlite support, which is what usually happens when you compile the interpreter yourself.

ghost commented 5 years ago

Please see screen shot screenshot

ghost commented 5 years ago

I exactly followed the steps in README.md

miguelgrinberg commented 5 years ago

And sqlite3 is not a dependency, it is part of Python, but in your installation it appears to be broken.

ghost commented 5 years ago

Yes, you are tight. That is what is happening. But if I run it directly it works, that is without virtual env. So why is it that virtual env creation would break this library?

miguelgrinberg commented 5 years ago

Maybe your virtualenv is configured to not look for packages in the system wide python? Unfortunately I don't use conda, so I really don't know if this is common or some problem with your installation. Odd that I never heard about it though, I have seen a fare share of conda users doing my tutorials.

ghost commented 5 years ago

Ye it is working with normal python installation. Some issues with Conda