python-openstackclient not working 'ImportError: No module named queue'

asked 2020-06-23 06:40:36 -0600

shrey_chauhan gravatar image

updated 2020-06-23 08:03:57 -0600

eblock gravatar image

Tried installing python-openstackclient==3.14.3, but the python client is giving error....tried the latest version as well

Error:

[root@test-001test]# openstack
Traceback (most recent call last):
  File "/usr/bin/openstack", line 5, in <module>
    from openstackclient.shell import main
  File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 23, in <module>
    from osc_lib import shell
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 33, in <module>
    from osc_lib.cli import client_config as cloud_config
  File "/usr/lib/python2.7/site-packages/osc_lib/cli/client_config.py", line 18, in <module>
    from openstack.config import exceptions as sdk_exceptions
  File "/usr/lib/python2.7/site-packages/openstack/__init__.py", line 16, in <module>
    import openstack.config
  File "/usr/lib/python2.7/site-packages/openstack/config/__init__.py", line 17, in <module>
    from openstack.config.loader import OpenStackConfig  # noqa
  File "/usr/lib/python2.7/site-packages/openstack/config/loader.py", line 33, in <module>
    from openstack.config import cloud_region
  File "/usr/lib/python2.7/site-packages/openstack/config/cloud_region.py", line 44, in <module>
    from openstack import proxy
  File "/usr/lib/python2.7/site-packages/openstack/proxy.py", line 24, in <module>
    from openstack import resource
  File "/usr/lib/python2.7/site-packages/openstack/resource.py", line 49, in <module>
    from openstack import utils
  File "/usr/lib/python2.7/site-packages/openstack/utils.py", line 13, in <module>
    import queue
ImportError: No module named queue

Can someone help with this? stuck here

Thanks

edit retag flag offensive close merge delete

Comments

Seems like an old version of openstackclient, can you share more information about your environment and which openstack version you're using?

eblock gravatar imageeblock ( 2020-06-23 08:06:30 -0600 )edit

I have python2.7, centos 7 I tried installing using 'pip install python-openstackclient' it got installed but i am getting this error

shrey_chauhan gravatar imageshrey_chauhan ( 2020-06-24 04:42:22 -0600 )edit

3 answers

Sort by » oldest newest most voted
1

answered 2020-08-03 12:32:41 -0600

João Antonio gravatar image

Python 2.7.17 Ubuntu 18.04.2 LTS

In my case, I altered the files utils.py and openstackcloud.py putting "import Queue as queue".

Note: Remember that the uppercase Q

vim /home/myuser/.local/lib/python2.7/site-packages/openstack/utils.py

...
#import queue
import Queue as queue
...

vim /home/myuser/.local/lib/python2.7/site-packages/openstack/cloud/openstackcloud.py

...
#import queue
import Queue as queue
...
edit flag offensive delete link more
0

answered 2020-06-27 04:25:43 -0600

Mohit gravatar image

Try this with python3 , pip3 . It works as the queue module name has been slightly changed/renamed in python3 to Q is in upper/lower case

edit flag offensive delete link more
0

answered 2020-06-23 22:40:22 -0600

remove existing openstack commandline version and then install the newest version of openstack command-line tool

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2020-06-23 06:40:36 -0600

Seen: 3,422 times

Last updated: Aug 03