Error while installing ggplot in python - python

I am getting this error when trying to install ggplot in Python:
ImportError: cannot import name unpack_url
I am using the following command:
sudo pip install ggplot
This error is in a linux environment, running fedora 21.

Looks like you might need to update your version of pip itself.
Entertainingly, you can upgrade pip using pip, as per the docs:
On Debian and Ubuntu:
sudo apt-get install python-pip
On Fedora:
sudo yum install python-pip

Related

Not able to install setuptools on linux mint

I used this command in terminal
sudo apt-get install python-setuptools
it throws up an error instead of installing -
Package 'python-setuptools' has no installation candidate
THis is a python package so you could use pip to install it
pip3 install setuptools
Try this:
sudo apt-get install python-pip
When pip is installed type in:
pip install setuptools
Hope this helps!

Install package paho-mqtt

I am trying to install paho-mqtt package for my python project. But it gives the error
Error: Python packaging tool 'pip' not found.
I am using ubuntu 16.04 and I am running this command
pip install paho-mqtt
Can anyone tell me is there another way to install this?
Install pip first, if using python2
sudo apt-get install python-pip
or for python3
sudo apt-get install python3-pip
Python uses pip to install various Python modules like request, jsonpickel etc.
So you need to install pip first as said by #Asoul

Cannot import installed python package

I'm trying to install python-numpy package on my ubuntu 14.04 machine. I ran sudo apt-get install python-numpy command to install it and it says the package has been installed but when i try to access it, i'm unable to do so.
When you type:
sudo pip install package-name
It will default install python2 version of package-name some packages might be supported in both python3 and python3 some might work might not
I would suggest
sudo apt-get install python3-pip
sudo pip3 install MODULENAME
or can even try this
sudo apt-get install curl
curl https://bootstrap.pypa.io/get-pip.py | sudo python3
sudo pip3 install MODULENAME
Many python packages require also the dev package, so install it too:
sudo apt-get install python3-dev
Also check for the sys.path [ make sure module is in the python path ]

Can't install zbar

I am trying to use the qrtools module with Python 3.4.2 on my Raspberry Pi 2, however it cannot run as I don't have the zbar module installed.
Trying
pip-3.2 install zbar
Gives the error message shown in the picture
sudo pip-3.2 install zbar
gives a similar error
Any ideas?
(I do have it installed with Python 2.7)
UPDATE: Both libzbar-dev and python3-dev are up to date. Still...
No module named 'zbar'
assuming you're using a debian derivative (like ubuntu), you need to install zbar's developement package, which contains the header file zbar.h
$ sudo apt-get install libzbar-dev
for redhat/fedora systems:
$ sudo yum install zbar-devel
and probably python's dev package too:
$ sudo apt-get install python3-dev
or you can use pip install zbar-py
https://pypi.org/project/zbar-py/
Try the following code after entering sudo mode:
yum install zbar-devel
This should work for fedora.
Bumping #herve solution
On ubuntu and on Mint
sudo apt-get install python-zbar libzbar-dev python-qrtools
pip install libzbar-cffi==0.2.1

ImportError: No module named pkg_resources on installing matplotlib

This is on CentOs 6.6. I am trying to set up a scientific python environment. I want to avoid Anaconda. When trying to install matplotlib, I get "ImportError: No module named pkg_resources". Full install history:
sudo yum install gcc-c++.x86_64
sudo yum install gcc
sudo yum install atlas atlas-devel lapack-devel blas-devel
sudo yum install python-devel
sudo pip install numpy
sudo pip install scipy
sudo pip install pandas
sudo pip install matplotlib
At the last step, I get the message
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
Then I do
sudo pip install --upgrade distribute
which installs distribute-0.7.3, setuptools-18.0.1. Then:
sudo pip install matplotlib
which results in:
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
Any ideas?
Update
After the above steps, setuptools and pip are broken in this installation. From a python shell, doing help() followed by modules does not list setuptools. A search in the filesystem for setuptools directories reveals:
/usr/lib/python2.6/site-packages/setuptools-18.0.1.dist-info/
while the setuptools.pth file in /usr/lib/python2.6/site-packages/ contains a pointer to the non-existent ./setuptools-0.6c11-py2.6.egg-info.
At the same time, there is a directory
/usr/share/doc/python-setuptools-0.6.10/
After all this, pip no longer works.
#pavan they said CentOS, so apt is unlikely to help them.
They could, though, do :
yum remove python-setuptools
yum install python-setuptools
(my also need to reinstall pip: yum install python-pip )
And that might fix the problem.
Try this for OS supporting apt-get (Ubuntu etc)
sudo apt-get install python-pkg-resources python-setuptools --reinstall
Try install python-pip (and dependencies):
yum install python-pip
This solved my problem (Centos release 6.8).

Categories