I started to experiment with shade today; and installed it for both python2 and python3 on my ubuntu 16.04 system; using:
sudo pip install shade
respectively
sudo pip3 install shade
Both commands passed; I didn't really pay attention.
Then I tried to run this little test script:
from shade import *
simple_logging(debug=True)
conn = openstack_cloud(cloud='myopenstack')
images = conn.list_images()
for image in images:
print(image)
Using python3, I got a certificate error (which is fine, I would be rather surprised to find our internal infrastructure to use correct certificates).
But just to be sure, I wanted to run with python2.7, too; and I am told:
ImportError: No module named shade
So, I had a closer look what pip and pip3 have to say:
> pip -V
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
> pip3 -V
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
It looks like both pip
and pip3
are actually working on my python3 installation, but when I do:
> python --version
Python 2.7.12
> python3 --version
Python 3.5.2
Any idea, anybody? What could be causing this, or how to actually install shade for python2/pip?
As requested:
> for i in pip pip3 python python3 ; do type $i ; done
pip is /usr/local/bin/pip
pip3 is /usr/local/bin/pip3
python is /usr/bin/python
python3 is /usr/bin/python3
pip3
looks like the default option pip
uses. Try using pip2
instead to explicitly install a Python 2 package.
Just change the first line of the /usr/local/bin/pip
to:
#!/usr/bin/python
and the first line of /usr/local/bin/pip3
to:
#!/usr/bin/python3
And then it will act normally:
> pip -V
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
> pip3 -V
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With