Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install pika using pip install

Getting the following after launching : pip install pika
(I have shorted the exception to first line in trace and last line)

Collecting Pika
  using cahced pika-0.10.0-py2.py3-none-any.whl
Installing collected packages : pika
Exception:
Traceback 
File" /usr/local/lib/python2.7/site-packages/pup/basecommand.py line 223 in main status = self.run(options, args)
.
.
.
File "/usr/local/lib/python2.7/os.py" line 157 in makedirs
mkdir(name ,mode)
OSError [Errno13] Permission denied: '/usr/local/lib/python2.7/site-packages/pika'

Also tried with sudo before but I got sudo pip,command not found.

like image 629
JavaSa Avatar asked Sep 20 '15 19:09

JavaSa


2 Answers

it's better to use virtualenv and run your application within a python sandbox but if you still want to install on your system packages I guess you should reinstall pip. if you're on ubuntu or debian just run sudo apt-get update and sudo apt-get install python-pip and then retry pip install pika with sudo: sudo pip install pika

like image 121
mehdy Avatar answered Sep 23 '22 16:09

mehdy


By this way, you are trying to install pika under global python installation, turning it available to whole system.

Permitions for global python installation is granted for root, by default. If you want to really install as global, you should use "sudo" or some other way to run as root, by example, "su".

To install using sudo, you can run like:

sudo apt-get install python-pika

or, using pip:

sudo pip install pika

By suggestion, If you don't need a global installation of pika, it is really recommended to install it under virtualenv, isolating this installations between each environment. For more information: http://docs.python-guide.org/en/latest/dev/virtualenvs/

like image 32
Andre Pastore Avatar answered Sep 23 '22 16:09

Andre Pastore