Subject: [mongodb-user] Re: Difficulties with installation
of python3 packages pymongo
Hello, Thank you for your attention. I join the install log in attached file.
Le mercredi 2 août 2017 19:44:11 UTC+2, Bernie Hackett a écrit :PyMongo 2.x uses 2to3
to convert itself to python 3 compatible syntax at install time. My guess is that in your "hand make" docker image 2to3 didn't run. I don't know why that would be. Can you try again using the -v option to pip, so we can see exactly how pip installs pymongo (pip3 install -v pymongo==2.9.5)?
On Tuesday, August 1, 2017 at 9:58:45 PM UTC-7, Bastien Sevajol wrote:Hello,
I have difficulties with installation of python3 version of pymongo package in version 2.9.5 (available here: https://pypi.python.org/pypi/pymongo/2.9.5
). I cannot use last pymongo package version because my project use Ming (https://pypi.python.org/pypi/Ming
) who only support pymongo<3.0.
When pymongo is installed on debian stretch or jessie, no problem. Installed files are python3 files. Example with docker:
1. Start a container with: docker run -it debian:stretch /bin/bash2. Install pymongo for python 3 with: apt-get update && apt-get install -y python3-pip && pip3 install pymongo==2.9.53. Check file a pymongo file: cat /usr/local/lib/python3.5/dist-packages/pymongo/__init__.py | grep basestring --> output is empty
But in "hand make" docker image:
1. Start teh container (i will detail how container is built)2. Install pymongo for python 3 with: apt-get update && apt-get install -y python3-pip && pip3 install pymongo==2.9.53. Check file a pymongo file (this test is positive in second case): cat /usr/lib/python3.5/site-packages/pymongo/__init__.py | grep basestring
---> output is: "if isinstance(version_tuple[-1], basestring):"
Code in /usr/lib/python3.5/site-packages/pymongo/ is python2 code. So it fail when executed with python3. The docker image is an image build with Yocto and https://layers.openembedded.org/layerindex/recipe/61661/
recipe. For example, some packages versions:
- python3 == 3.5.2 - python3-pip == 9.0.1 - git == 2.11.1- gcc == 6.3.0- binutils == 2.28
Do you have an idea why pymongo package is installed with python2 files in second case ? Thank you,
Note: i don't know with but in debian stretch example, pymongo files are in /usr/local/lib/python3.5/dist-packages dir and in my "hand make" docker image pymongo files are in /usr/lib/python3.5/site-packages.
You received this message because you are subscribed to the Google Groups "mongodb-user"
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]
To post to this group, send email to [email protected]
Visit this group at https://groups.google.com/group/mongodb-user
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/9ca1e63d-fae7-4bd3-b802-07abfee909be%40googlegroups.com
For more options, visit https://groups.google.com/d/optout
Description: Text document