Skip to content
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

No dumps since 0.5.0 version #69

Open
tangb opened this issue Nov 14, 2017 · 9 comments
Open

No dumps since 0.5.0 version #69

tangb opened this issue Nov 14, 2017 · 9 comments

Comments

@tangb
Copy link

tangb commented Nov 14, 2017

My code uses dumps function and since last update (0.5.0), this function doesn't exist.
Is it possible to update documented sample ?

Thank you 😄

@Parkayun
Copy link
Member

I will check.
Thanks for report

@tangb
Copy link
Author

tangb commented Nov 17, 2017

It seems a module bson is installed with pymongo that overwrites your module content directory.
It's why I hadn't your module functions when I imported bson module while I had bson 0.5.0 installed.

@joliveros
Copy link

I'm not using py-mongo and am able to reproduce this issue:

Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bson
>>> bson.dumps
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'bson' has no attribute 'dumps'
>>>

@Parkayun
Copy link
Member

 ~  mkdir bson-test                                                                                                                                                                                                            (1s 433ms)
 ~  cd bson-test
 ~/bson-test  python -m venv bson_test_venv .
 ~/bson-test  . bin/activate.fish                                                                                                                                                                                              (5s 111ms)
(bson-test)  ~/bson-test  pip install bson
Collecting bson
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/b9/42/e823b5f13515e3af308fb6efcacff456fc59078ec0e9ac426e842d66c9cb/bson-0.5.8.tar.gz
Collecting python-dateutil>=2.4.0 (from bson)
  Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
    100% |████████████████████████████████| 235kB 658kB/s
Collecting six>=1.9.0 (from bson)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, bson
  Running setup.py install for bson ... done
Successfully installed bson-0.5.8 python-dateutil-2.8.0 six-1.12.0
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(bson-test)  ~/bson-test  python                                                                                                                                                                                               (5s 264ms)
Python 3.6.1 (default, Apr 19 2017, 20:04:37)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import bson
>>> bson.dumps
<function dumps at 0x108dd8598>
>>> bson.dumps({'hello': 'world'})
b'\x16\x00\x00\x00\x02hello\x00\x06\x00\x00\x00world\x00\x00'
>>> exit()
(bson-test)  ~/bson-test 

I just tired and couldn't reproduce. I will look for it more when get more information.

@luckydonald
Copy link

luckydonald commented May 15, 2020

I'm getting this error with pymongo installed. Could you maybe pack it as a different name?

@Parkayun
Copy link
Member

I will consider with pybson

@luckydonald
Copy link

That would be wonderful.

@Parkayun
Copy link
Member

#41 (comment)

@Aditya-Filed
Copy link

In my case, I had a problem installing the pymongo package. It created ymong named file inside the venv/site-packages. I just deleted those and it worked ! These files probably starts with the ~ prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants