Miserlou / NoDB

NoDB isn't a database.. but it sort of looks like one.
https://blog.zappa.io/posts/introducing-nodb-pythonic-data-store-s3
380 stars 45 forks source link

Error using NoDB on python3 #23

Open ori-n opened 6 years ago

ori-n commented 6 years ago

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?

bendog commented 6 years ago

which version are you using?

brooksc commented 6 years ago

Hitting the same issue with python 3.6.3

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

tkuster-drod commented 6 years ago

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.

ori-n commented 6 years ago

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.

brooksc commented 6 years ago

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?

FlipperPA commented 6 years ago

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

ori-n commented 6 years ago

Is there any progress with this issue? Thanks

FlipperPA commented 6 years ago

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

antgel commented 5 years ago

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

antgel commented 5 years ago

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.

FutureSharks commented 5 years ago

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.

bendog commented 5 years ago

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

bendog commented 5 years ago

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

bendog commented 5 years ago

this will be resolved with #19