ImportError: The _imagingft C module is not installed - python

I use django-simple-captcha in django.
Command: ./manage.py test apatcha shows the error "ImportError: The _imagingft C module is not installed"
I already install the package in the order below:
yum install freetype-devel libjpeg-devel libpng-devel
pip uninstall Pillow
pip uninstall Pillow-PIL
pip install Pillow
pip install Pillow-PIL
But it still doesn't work.
Where am I wrong?
System:CentOS 6.5
Python: The _imagingft C module is not installed
The link above doesn't solve my problem, otherwise I won't be here.
Finally, I solve my problem by download the tar.gz file from official website and install it manually.

pip uninstall PIL - and -
pip install pillow
for windows these 2 commands worked for me

Python: The _imagingft C module is not installed
The link above doesn't solve my problem, otherwise I won't be here. Finally, I solve my problem by download the tar.gz file from official website and install it manually.
By the way, should I always paste the hot links which didn't solve my problem to prove I did googled before I ask?

Related

I installed Pillow but i get "ModuleNotFoundError: No module named 'PIL'"

When I try to use from PIL import ImageGrab it gives me this error:
ModuleNotFoundError: No module named 'PIL'
I installed it with pip install pillow and checked if it is installed with pip show pillow. It says I have Version: 8.1.2
I am using python 3.9 and sublime text 3
In the internet I saw most people with that problem have a not maching python version with the pillow version, but mine should work as far as I understood..? (https://pillow.readthedocs.io/en/stable/installation.html)
However its not working and I am trying to fix this since about two hours and I hope somebody can help me.
You might have different versions of python installed and pip is installing pillow for a different version.
A good way to avoid this is using python -m pip install pillow instead of pip install pillow.
Try to install it with pip3 install pillow
The fact is that you installed it for python2 but your are using python3 ;)

ImportError: No module named skimage, already have scikit-image installed

I am trying to use skimage on mac, and already install the packages with virtualenv, but when I do "from skimage import io", it gave me this error :"ImportError: No module named skimage".
I am wondering if there is anything wrong installation process, but so far I cannot figure it out.
Below is my installation process:
sudo pip install virtualenv
cd /my/project/folder
virtualenv myproject
source myproject/bin/activate
pip install -U scikit-image
Then the result is:
"Successfully installed PyWavelets-0.5.2 cycler-0.10.0 decorator-4.0.11 functools32-3.2.3.post2 matplotlib-2.0.0 networkx-1.11 numpy-1.12.1 olefile-0.44 pillow-4.0.0 python-dateutil-2.6.0 pytz-2017.2 scikit-image-0.13.0 scipy-0.19.0 subprocess32-3.2.7"
It seems that I already have everything, but why import skimage still failed?
Besides, I also tried to used the installation guidance on http://scikit-image.org/download with "pip install -U scikit-image" and "easy_install -U scikit-image", but also failed.
I am on Mac Sierra, with python 2.7. Any suggestion would highly appreciated. Thanks!
conda environment manager fixes this problem.
conda install --yes -c conda-forge scikit-image
I'm using Linux and I couldn't get it working without doing
sudo apt-get install python-skimage
And I got that from the installation page of the docs:
http://scikit-image.org/docs/stable/install.html
I'm not familiar with osx, but maybe try using a package manager like homebrew to install the package like so.
sudo homebrew install python-skimage
I'm actually quite puzzled as to why theres no OSX section in the install section of the docs, but a tiny bit of information in the downloads section.

Getting ImportError: No module named 'Crypto' after installation

I am getting ImportError: No module named 'Crypto' error when trying to run. I have installed pycrypto using pip install pycrypto and updated it also. Everything I have tried to far has been unsuccessful.
Tried:
reinstalling pycrypto,
updating both python and pycrypto
Any suggestions?
The error messages says, it does not able to find the module so please try to run below command,
#pip list -- # what does it show to you, if it would have installed successfully it will show you up there.
if "pip install pycrypto" doesn't work so try to download the source tar ball and try to install it from prompt.
pip download pycrypto
it will download tar.gz file.. so you can install using with pip install --no-index --find-links /path/to/some/dir/ pycrypto
for python3.5 version
python3.5 -m pip install pycrypto
this will install in python3.5 environment and after that you can able to import pycrypto module
Is python defined properly on your machine?
Make sure PATH environment variable has python's installation folder in it

python install module apiclient

New to python, and trying to install a module "apiclient"
since my ide pycharm does not recognize that import:
from apiclient.discovery import build
what I tried:
pip install apiclient
download manually the package from
https://developers.google.com/api-client-library/python/start/installation#system-requirements
then I extracted it into
/Users/nirregev/anaconda/bin/google-api-python-client-1.5.0
and ran this on my mac terminal
python setup.py install
but still pycharm does not recognize this module.
According to pycharm I have the following interpreters installed:
/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5
/Users/nirregev/anaconda/bin/python
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Try this:
sudo pip install --upgrade google-api-python-client
OR
Make sure you only have google-api-python-client installed. If you have apiclient installed, it will cause a collision. So, run the following:
pip install --force-reinstall google-api-python-client
Answer Source
I ran into this problem and had a tough time figuring it out. In the end, this worked for me:
pip install google-api-python-client==1.5.3
Before doing this, I had version 1.6.2 installed. What I think is going on is that later versions of google-api-python-client dropped the apiclient in favor of the googleapiclient alias; which is an issue because some packages (e.g. airflow) still use that apiclient.discovery import.
Hope this helps.
If you have python3 installed somewhere and you are to install apiclient, it may be installing it in your python3 directory. I had the same problem and when I uninstalled python3 my program ran smoothly.
If you have got both python 2 and python 3 and you're trying to use python 2 for this purpose try the following: sudo pip2 install google-api-python-client==1.5.3 . This worked for me.
I am on Mac, using brew's python, and this worked for me:
1 - As suggested by others, install the API client using pip:
sudo pip install --upgrade google-api-python-client
2 - Make sure you are calling the library in your code as googleapiclient, and not as apiclient, which is deprecated.
3 - Tell Python to look for packages in the pip folder:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
To make it permanent, add the above line to either your .profile or .bash_profile file in your $HOME.

import Error: No Module named cropresize

I am new to python. I am working on some other's project but when i tried to run the code it give me the error said above. My all pages are working properly except those in which i had images. Is there any library required for the same??
Any help will be appreciable.
Thanks
you need to have cropresize package http://pypi.python.org/pypi/cropresize/ installed on your device.
If it is not there install it from the link
Do easy_install cropresize or pip install cropresize
Just do easy_install cropresize.
cropresize package needs to be installed! First install pip(Ubuntu/Debian):
sudo apt-get install python-pip
Then install cropresize using pip:
pip install cropresize
cropresize (all versions) depends on PIL.
Unfortunately, Pillow (installed) does not satisfy this dependency when using pip or easy_install :(

Categories