I am trying to install this package pyowm via pip. but it is not working for some reason. It is a ubuntu 16 VM. I have used pip to install other packages and it has all worked fine before so I am not sure why this one is having problems.
ubuntu@ip-172-31-22-187:~/.cache/pip$ pip install pyowm
Collecting pyowm
Installing collected packages: pyowm
Exception:
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/ubuntu/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/ubuntu/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/home/ubuntu/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/ubuntu/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/ubuntu/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/ubuntu/.local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/home/ubuntu/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pyowm-2.5.0.dist-info'
As you can see it thinks I don't have the right permission. So I did this instead:
ubuntu@ip-172-31-22-187:/usr/local/lib/python2.7/dist-packages$ sudo -H pip install pyowm
Collecting pyowm
Installing collected packages: pyowm
Successfully installed pyowm-2.5.0
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
But when I try to call it this happens:
ubuntu@ip-172-31-22-187:~/.cache/pip$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyowm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'pyowm'
>>>
So now I am very confused. pip says it did the job, but pyowm doesn't show up? The result is same for python 2.7 or 3.5.
And I can see that the pyowm stuff is there:
ubuntu@ip-172-31-22-187:/usr/local/lib/python2.7/dist-packages/pyowm$ pwd
/usr/local/lib/python2.7/dist-packages/pyowm
ubuntu@ip-172-31-22-187:/usr/local/lib/python2.7/dist-packages/pyowm$ ls
abstractions caches commons constants.py constants.pyc exceptions __init__.py __init__.pyc utils webapi25
And I did try to upgrade pip as well but this is what I got:
ubuntu@ip-172-31-22-187:/usr/local/lib$ pip install --upgrade pip
Requirement already up-to-date: pip in /home/ubuntu/.local/lib/python2.7/site-packages
ubuntu@ip-172-31-22-187:/usr/local/lib/python2.7/dist-packages/pyowm$ pip -V
pip 9.0.1 from /home/ubuntu/.local/lib/python2.7/site-packages (python 2.7)
So I am very very confused. I am at version 9.0.1, but why does the cmd output earlier show I am on version 8? Why do I suddenly need to sudo to install pyowm when yesterday I installed reportLab without needing sudo? Why after installing it with sudo I can't call on pyowm?