Error when I try to " pip install tweepy"


#1

Hi, I would like to use the Tweepy API (http://www.tweepy.org/) to read twitter, but if I try to install it , I get this error

1.- I download the API and Upload to my workspace
2.- I run --> pip install tweepy

but I get this error. Am I doing something wrong??

Can you help me pleae? Thanks

pocmns:~/workspace (master) $ pip install tweepy
Downloading/unpacking tweepy
Downloading tweepy-3.5.0-py2.py3-none-any.whl
Downloading/unpacking requests>=2.4.3 (from tweepy)
Downloading requests-2.13.0-py2.py3-none-any.whl (584kB): 584kB downloaded
Downloading/unpacking six>=1.7.3 (from tweepy)
Downloading six-1.10.0-py2.py3-none-any.whl
Downloading/unpacking requests-oauthlib>=0.4.1 (from tweepy)
Downloading requests_oauthlib-0.8.0-py2.py3-none-any.whl
Downloading/unpacking oauthlib>=0.6.2 (from requests-oauthlib>=0.4.1->tweepy)
Downloading oauthlib-2.0.1.tar.gz (122kB): 122kB downloaded
Running setup.py (path:/tmp/pip_build_ubuntu/oauthlib/setup.py) egg_info for package oauthlib

Installing collected packages: tweepy, requests, six, requests-oauthlib, oauthlib
Cleaning up…
Exception:
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/pip/basecommand.py”, line 122, in main
status = self.run(options, args)
File “/usr/lib/python2.7/dist-packages/pip/commands/install.py”, line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File “/usr/lib/python2.7/dist-packages/pip/req.py”, line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File “/usr/lib/python2.7/dist-packages/pip/req.py”, line 672, in install
self.move_wheel_files(self.source_dir, root=root)
File “/usr/lib/python2.7/dist-packages/pip/req.py”, line 902, in move_wheel_files
pycompile=self.pycompile,
File “/usr/lib/python2.7/dist-packages/pip/wheel.py”, line 206, in move_wheel_files
clobber(source, lib_dir, True)
File “/usr/lib/python2.7/dist-packages/pip/wheel.py”, line 193, in clobber
os.makedirs(destsubdir)
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/tweepy-3.5.0.dist-info’

Storing debug log for failure in /home/ubuntu/.pip/pip.log


#2

I reply myself…I found the solution, --> “sudo pip3 install tweepy”, worked for me!