NoDB icon indicating copy to clipboard operation
NoDB copied to clipboard

Error using NoDB on python3

Open ori-n opened this issue 6 years ago • 14 comments

When I tried the basic example I got the following error:

user = {"name": "Jeff", "age": 19} nodb.save(user) # True

AttributeError: 'dict' object has no attribute 'has_key' which seems like a python3 compatibility issue. Anyone can help?

ori-n avatar Aug 09 '18 13:08 ori-n

which version are you using?

bendog avatar Aug 13 '18 08:08 bendog

Hitting the same issue with python 3.6.3

using the same sample code as above and from the readme.

brooksc avatar Aug 23 '18 22:08 brooksc

Which version of NoDB? All the has_keys were removed from the code base and other changes to make it python3 compatible in v0.4. v0.3.3 would still have them and it is not python3 compatible.

tkuster-drod avatar Aug 23 '18 23:08 tkuster-drod

I installed latest for python 3.6 and got v0.3.2

Thanks, Ori

מאת: tkuster-drod נשלח: יום שישי, 24 באוגוסט, 02:06 נושא: Re: [Miserlou/NoDB] Error using NoDB on python3 (#23) אל: Miserlou/NoDB עותק: ori-n, Author

Which version of NoDB? All the has_keys were removed from the code base and other changes to make it python3 compatible in v0.4. v0.3.3 would still have them and it is not python3 compatible. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Miserlou/NoDB/issues/23#issuecomment-415600595, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfvrAPk0GyK3-NaIiAbz4Wg1nR0Cqveeks5uTzVhgaJpZM4V1tTS.

ori-n avatar Aug 24 '18 05:08 ori-n

I also did a pip install nodb and it installed nodb 0.3.2.

Do you have plans to push the newer version to pypi?

brooksc avatar Aug 24 '18 18:08 brooksc

I want to talk to @Miserlou before we publish to PyPI, but for now, can you:

pip install git+https://github.com/Miserlou/NoDB.git@4616921

FlipperPA avatar Aug 24 '18 19:08 FlipperPA

Is there any progress with this issue? Thanks

ori-n avatar Sep 06 '18 13:09 ori-n

I don't have access to push this to PyPI, but for now, you can:

pip install git+https://github.com/Miserlou/NoDB.git@4616921

You can also add this to your requirements file:

git+https://github.com/Miserlou/NoDB.git@4616921

FlipperPA avatar Sep 06 '18 13:09 FlipperPA

I'm also seeing this, thanks @FlipperPA for the workaround.

antgel avatar Nov 04 '18 15:11 antgel

However, there's a problem with @FlipperPA 's workaround. I'm trying to deploy a Falcon app to Elastic Beanstalk with Python 3.6. However, futures being installed which breaks the deploy. Therefore it seems impossible to use nodb in this context at the moment.

antgel avatar Nov 06 '18 15:11 antgel

I have the same problem as @antgel

Using commit ID 4616921, it installs futures>=3.0.5 which is only for Python2.

For me on AWS Lambda this doesn't work:

Syntax error in module 'main': invalid syntax (_base.py, line 381)

Issue is here: https://github.com/agronholm/pythonfutures/issues/41 Some info here: https://pypi.org/project/futures/

Python 3 users should not attempt to install it, since the package is already included in the standard library

Workaround

Delete <python path>/concurrent and <python path>/futures* from your zip package. It's hacky but I don't know a better way.

FutureSharks avatar Aug 23 '19 10:08 FutureSharks

Perhaps we should just drop support for python2 as it only has a couple of months left?

bendog avatar Sep 12 '19 02:09 bendog

i've removed futures from requirements.txt in the latest pull request #26 this should resolve this issue

bendog avatar Sep 12 '19 04:09 bendog

this will be resolved with #19

bendog avatar Sep 12 '19 05:09 bendog