pycontribs / pyrax

The Python SDK for the Rackspace Cloud
developer.rackspace.com
Apache License 2.0
237 stars 208 forks source link

AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'SplitResult' #514

Open jribbens opened 9 years ago

jribbens commented 9 years ago

The above error is what you get when doing 'import pyrax'. This is because setup.py incorrectly says that pyrax needs 'six' version 1.5.2, when in fact it needs a newer version than that. I think it might need 1.6. 1.8 definitely works.

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyrax
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 59, in <module>
    from novaclient.shell import OpenStackComputeShell as _cs_shell
  File "/usr/local/lib/python2.7/dist-packages/novaclient/shell.py", line 47, in <module>
    from novaclient import client
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 34, in <module>
    from oslo.utils import netutils
  File "/usr/local/lib/python2.7/dist-packages/oslo/utils/netutils.py", line 78, in <module>
    class _ModifiedSplitResult(parse.SplitResult):
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'SplitResult'
phikai commented 9 years ago

I had the same issue which seems to be a bit of a problem over here too (may be useful in fixing) https://bugs.launchpad.net/devstack/+bug/1316328

This fixed it for me:

sudo pip install six --upgrade

sivel commented 9 years ago

The dependency on six within pyrax is that it only needs at least six 1.5.2. However the dependency in python-novaclient/oslo.utils may be a higher version. Versions higher than 1.5.2 also meet the dependency of pyrax.

NicoDuclos commented 9 years ago

I had the same issue with duplicity 0.7 on ubuntu 14.04. I have six version 1.9 so an update didn't fix it.

The problem was that oslo.utils was installed (with pip) and the python-novaclient ubuntu package wasn't. Perhaps pyrax should have trigger an exception in this case ?

So I just had to install python-novaclient and it worked.

$ sudo apt-get install python-novaclient
powellchristoph commented 9 years ago

I dealt with the same issue as @nikosnikos . Install the novaclient via system packages resolved the problem.

yeasy commented 9 years ago

The same problem happens at the Juno version. Temporarily work around it in the same way as @nikosnikos.

geongo commented 9 years ago

For me I had to install both novaclient and glanceclient $ sudo apt-get install python-novaclient $ sudo apt-get install python-glanceclient

cwillenterprise commented 8 years ago

This can help someone else. To correct the problem I had to remove all the packages installed with pip and reinstall them with the package manager.

Test the module by importing it in the python shell.