-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
"Exception: No suitable database adapter found!" for package examples #31
Comments
checked on Linux (Ubuntu on Win10) - same behavior |
any further information? I have just tried the database_example.py and it works as expected. |
I'm running on python 3.5.2. Which version you run it on? |
I used python 2.7 |
Here is the log
|
I tried again with 3.6.3 on import use case. Worked for me. |
Let me try it on py 3.5.2 |
It's strange, it doesn't work on 2.7.12 either, not sure what is the catch. Cannot imagine what can be wrong similar way on both Win and Linux. Here is the log: (env2) yuryf@FThi:~/projects/test.flask-excel$ python ./database_example.py
|
have integrated the code from 'database_example_formatted.py' into the existing project on 3.5.2 working with MySQL, and still get the same exception. The rest of the project works fine with the db, so very curious on what it could be. |
The nature of the exception is your book got more sheets than the number of tables to be imported. |
I'm running the example 'database_example_formatted.py' with (what I assume it is) test data file 'example_for_upload.csv' from the same git directory. Shall I use something else? |
You should use sample.xls |
Where can I take it or shall I create my own? If I need to create own then is there any logic of the content I need to follow? Number of sheets, number of columns on each sheet, headers etc.? |
created my own version https://www.dropbox.com/s/zbzpr368l88re8n/sample.xlsx?dl=0 but no luck so far, still same exception. Also tried this version without column headers, but still same result. |
Thank you very much for your support @chfw , finally I've figured out things about example code and was able to run it without issues. Probably would make sense to add a note somewhere in the readme that the file sample-data.xls should be used as input and it's located in the root of the project. May also make sense to note packages pyexcel-xlsx, pyexcel-xls and pyexcel-handsontable, which need to be installed in order to run the sample code smoothly. Let me know if I have to close the issue or you'd prefer to do it yourself |
I will take your feedback and then close this issue. Thanks for trying. |
Maybe one more comment - I'm now integrating with flask-excel, and again, getting the same exception. Now I'm sure there is something wrong with my code, but there is no way to figure out what's wrong other than trial&error approach, very time consuming. May make sense to make the error more meaningful so that developer can quickly understand what's wrong and fix it. Especially that this error doesn't sound like something to do with database adapter (maybe I'm wrong), it's more like a generic error) |
OK. I will update the error too. The exception says: if you got three sheets in a book but you have only given 2 tables, the third dangling one will not be handled hence the error try to flag it up. |
Not only that, it's also that the sheet name (in xls) and the table name (in db where the data is imported to) should match exactly. Class name maybe different though, despite a comment to the previous similar issue. At least this is my current finding |
Sorry, closed by mistake |
I see. I will point it out in the exception too. I am sorry for the mis-leading error message which is not helpful and requires my interpretation. |
While running flask-excel examples (database_example.py and database_example_formatted.py) in python3 on Windows face with the above exception. Will try on linux and report here as well
The text was updated successfully, but these errors were encountered: