ImportError: No module named ordered_dict

Can you confirm that you reproduce the issue if you just run :

python -c "import requests;"

Anyway it looks like there’s definitely something funky with your installation of python-requests

I would try to check the output of dpkg --list | grep python-requests

$ dpkg --list | grep python-requests
ii  python-requests                       2.12.4-1 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 63, in <module>
    from . import utils
  File "/usr/lib/python2.7/dist-packages/requests/utils.py", line 24, in <module>
    from ._internal_utils import to_native_string
  File "/usr/lib/python2.7/dist-packages/requests/_internal_utils.py", line 11, in <module>
    from .compat import is_py2, builtin_str, str
  File "/usr/lib/python2.7/dist-packages/requests/compat.py", line 46, in <module>
    from .packages.urllib3.packages.ordered_dict import OrderedDict
ImportError: No module named ordered_dict

And so dpkg --list | grep python-requests

ii python-requests 2.12.4-1
d simple HTTP library for Python2, built for human beings

everything was fine, it starts to happen when i installed aws cli and the error pop up during installation.
so i was just looking around to fix it, i think by mistake when cmd pip3 to install endpoint plugin doesnt work i also installed python 3 as well, which could be the reason behind this error.

just guessing not really sure though

pip3 install awscli-plugin-endpoint

Python

What about

dpkg --verify python-requests

(the command should return nothing)

Yeah it return nothing

Weeeeelll …

what about

python -c "import urllib3.packages.ordered_dict;"
dpkg --list | grep python-urllib3

and

dpkg --verify python-urllib3
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named ordered_dict

ii python-urllib3 1.19.1-1 all HTTP library with thread-safe connection pooling for Python

Returns nothing

So if you run

/usr/lib/python2.7/dist-packages/urllib3/packages/

there’s no ordered_dict.py ?

What about dpkg -L python-urllib3 | grep "/packages/" | grep "py$"

there’s no ordered_dict.py ?

There is

/usr/lib/python2.7/dist-packages/urllib3/packages/__init__.py
/usr/lib/python2.7/dist-packages/urllib3/packages/backports/__init__.py
/usr/lib/python2.7/dist-packages/urllib3/packages/backports/makefile.py
/usr/lib/python2.7/dist-packages/urllib3/packages/ordered_dict.py
/usr/lib/python2.7/dist-packages/urllib3/packages/ssl_match_hostname/__init__.py
/usr/lib/python2.7/dist-packages/urllib3/packages/ssl_match_hostname/_implementation.py

Djeez what’s going on …

Can you try

python -c "import sys; print(sys.path)"

and

python -c "import urllib3; print(urllib3)"

im also clueless if you wanna look into server i can provide you access

['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']

<module ‘urllib3’ from ‘/usr/local/lib/python2.7/dist-packages/urllib3/init.pyc’>

That’s it : that one is loaded from /usr/local, probably meaning it got installed globally by pip.

So looks like the version of urllib3 installed is inconsistent with the version of requests…

My guess is that it can be fixed by running pip2 install requests

But ultimately it sounds like it has nothing to do with Yunohost or Pip3 …

Bump ? Did it fix the issue ? :confused:

Requirement already satisfied: requests in /usr/lib/python2.7/dist-packages

it didnt solved the issue

Can you retry adding --ignore-installed ?

i was trying to fix this myself and end up messing it up by removing python 3.5 and it messed up with yunohost :zipper_mouth_face:

how to fix this and get back yunohost panel? should i do the installation again?

im getiing 403 Forbidden on visiting admin panel although yunohost/sso/ is still up and i can login in it

recovered all the pacakge and now post install showing an error

Error when trying to inject 'cn=admin,ou=sudo' -> '{'cn': 'admin', 'sudoCommand': 'ALL', 'sudoUser': 'admin', 'objectClass': ['sudoRole', 'top'], 'sudoOption': '!authenticate', 'sudoHost': 'ALL'}' into ldap: error during LDAP add operation with: rdn='cn=admin,ou=sudo', attr_dict={'cn': 'admin', 'sudoCommand': 'ALL', 'sudoUser': 'admin', 'objectClass': ['sudoRole', 'top'], 'sudoOption': '!authenticate', 'sudoHost': 'ALL'} and exception {'desc': 'Already exists'}

Error when trying to inject 'cn=admins,ou=groups' -> '{'objectClass': ['posixGroup', 'top'], 'memberUid': 'admin', 'gidNumber': '4001', 'cn': 'admins'}' into ldap: error during LDAP add operation with: rdn='cn=admins,ou=groups', attr_dict={'objectClass': ['posixGroup', 'top'], 'memberUid': 'admin', 'gidNumber': '4001', 'cn': 'admins'} and exception {'desc': 'Already exists'}

Error when trying to inject 'ou=apps' -> '{'objectClass': ['organizationalUnit', 'top'], 'ou': 'apps'}' into ldap: error during LDAP add operation with: rdn='ou=apps', attr_dict={'objectClass': ['organizationalUnit', 'top'], 'ou': 'apps'} and exception {'desc': 'Already exists'}

Error when trying to inject 'ou=sudo' -> '{'objectClass': ['organizationalUnit', 'top'], 'ou': 'sudo'}' into ldap: error during LDAP add operation with: rdn='ou=sudo', attr_dict={'objectClass': ['organizationalUnit', 'top'], 'ou': 'sudo'} and exception {'desc': 'Already exists'}

Error when trying to inject 'ou=groups' -> '{'objectClass': ['organizationalUnit', 'top'], 'ou': 'groups'}' into ldap: error during LDAP add operation with: rdn='ou=groups', attr_dict={'objectClass': ['organizationalUnit', 'top'], 'ou': 'groups'} and exception {'desc': 'Already exists'}

Error when trying to inject 'ou=domains' -> '{'objectClass': ['organizationalUnit', 'top'], 'ou': 'domains'}' into ldap: error during LDAP add operation with: rdn='ou=domains', attr_dict={'objectClass': ['organizationalUnit', 'top'], 'ou': 'domains'} and exception {'desc': 'Already exists'}

Error when trying to inject 'ou=users' -> '{'objectClass': ['organizationalUnit', 'top'], 'ou': 'users'}' into ldap: error during LDAP add operation with: rdn='ou=users', attr_dict={'objectClass': ['organizationalUnit', 'top'], 'ou': 'users'} and exception {'desc': 'Already exists'}

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.