PINAX & PIL Installation on Windows 7 - python

I have Python 2.7 on Windows 7 x64. I have installed virtualenv and installed Pinax withing the project in virtualenv. When I try to syncdb I recieve an error stating PIL is needed. I tried installing PIL 1.1.7 for 2.7, but it did not install correctly. When I ran syncdb I get the following error.
Error: One or more models did not validate:
photologue.photo: "image": To use ImageFields, you need to install the Python Im
aging Library. Get it at http://www.pythonware.com/products/pil/ .
photologue.watermark: "image": To use ImageFields, you need to install the Pytho
n Imaging Library. Get it at http://www.pythonware.com/products/pil/ .
avatar.avatar: "avatar": To use ImageFields, you need to install the Python Imag
ing Library. Get it at http://www.pythonware.com/products/pil/ .
photos.image: "image": To use ImageFields, you need to install the Python Imagin
g Library. Get it at http://www.pythonware.com/products/pil/ .
As I understand it is because this is a x32. So I downloaded the unoffical x64 version from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil and tried to install. Windows installer states that it can not locate python so it can not install PIL. I checked the registry and python is there.
Any thoughts because I am lost?

It's been awhile since I worked on Windows, but I believe you might need to install a 64-bit version of Python. I could be wrong, but I wouldn't think that 32-bit Python would be able to run 64-bit libraries. I think the error message you are seeing is that the 64-bit PIL is looking for 64-bit Python and can't find it.

You can install 32 bit PIL on Win7x64 as long as you are running 32 bit Python.

Related

Import raster files into Python 3.10

I'm working on a project that requires the python 3.10 version but am having some difficulty accessing the files on that version. These files have the '.tiff' extension and contain metadata information about multispectral bands like resolution, band number, etc. I was able to import the files using the rasterio module in 3.9 version but couldn't get it to work on 3.10 and couldn't find another module perform the task. I would appreciate any advice on this, thanks.
As of today, doing pip install raster will attempt to install rasterio-1.2.10, which supports Python 3.6 to 3.9. For Python 3.10 support, you'll need to rasterio 1.3, which is currently in beta. You can install 1.3 beta 3 with pip install rasterio==1.3b3.
Try using : pip install whatever_you_want
In the shell. It resets the package and it should work.
like: if you want to install ‘Replit’ just do pip install replit in the command shell

Python OpenCV Installation - DLL error while importing cv2

I've been trying to set up OpenCV on my computer for the past 3 days and haven't able to install it.
I have tried different versions of Python and OpenCV but nothing seems to be working as I'm always getting an error:
DLL error while importing cv2: The specified module could not be found.
Can someone help me to set up python, anaconda, OpenCV on my computer as I'm now completely frustrated as I've tried almost 30 different methods but in vain.
You can download the latest OpenCV 3.2.0 for Python 3.6 on Windows 32-bit or 64-bit machine, look for file starts withopencv_python‑3.2.0‑cp36‑cp36m, from this unofficial site. Then type below command to install it:
pip install opencv_python‑3.2.0‑cp36‑cp36m‑win32.whl (32-bit version)
pip install opencv_python‑3.2.0‑cp36‑cp36m‑win_amd64.whl (64-bit version)
I think it would be easier.
Try running:
pip install opencv-contrib-python

Pango Import is not working

I am very new into this python and its dependencies.
I'm trying to install Cairo and Pango,
I have successfully installed Cairo, Cairocffi, cffi, Pygi, and gtk+, and they are working just fine.
I have tried many ways for the past three days to set up Pango, but it did not working at all.
FYI I'm using Windows 10 64 bit system and Python27
I've seen one tutorial from this site https://community.webfaction.com/questions/11481/how-to-install-pango-and-cairo-pangocairo-for-python
but it's Unix based, Is there any any I can do this in windows version?
and from other site, they said after downloading and installing I should compile pango and pygtk ? How can I do so in windows ? Thank you
Hard to say,, but I'd suggest you start over with an install of anaconda, https://www.continuum.io/downloadsparticularly since you are using Windows.. Then using Anaconda install the other packages.

I cannot install dipy library for python, why ? In the description I explain what I did

I went to http://nipy.org/dipy/installation.html and install nibabel, then I when I wanted to install dipy, there where 2 problems:
Wheel was not built
and vcvarshall.bat not found.
What I did ?
Install Setuptools in site-pakcages
download Setuptools-34.3.1-py2.py3-none-any.whl (md5) and save in site-packages
I also try
python setup.py install --compiler=mingw32ç
and
If you get an error saying unable to find vcvarsall.bat then you need to create a file called pydistutils.cfg in notepad and give it the contents
[build]
compiler=mingw32
But setup.py de system it did not find, and I still have vcvarshall.bat not found.
what I need to do?
I am using, Windows 7, Python 3.5.1 and Anaconda 2.5.0 (64 bit)
You will almost certainly find it easier to install third-party packages if you adopt virtual environments. When done correctly you will then not need admin privileges to install packages into virtualenvs. The HitchHikers' Guide to Python contains more information about this.
The vcvarsall.bat is, I believe, a part of the Visual Studio (the Express version is available at no cost) environment. It's required when you are trying to build a compiled Python extension as described in this article. I'm not sure how that will play with mingw.
So, I installed via ANACONDA but , when I go to python, and I want to import dipy it says: No modle named dipy
Solved ! Well I had python 3.5 and dipy has some issues with that version, so I installed Anaconda with python 2.7 , installed visual c++9 and follow the steps on the web !

unable to find vcvarsall,bat error while installing simplecv on windows 10?

During the installation phase, I get this, "Unable to find vcvarsall.bat" error. The installation process did complete, though. However, I was unable to see the shell on my desktop (I am using windows) and neither was I able to open it manually. I scoured the internet for the error but was unable to find any solution for this case.
The installation process is through a superpack that downloads Python 2.7
SimpleCV is not receiving much love in the past few years, and most of it's code don't got upgrade like the libraries it depends on.
The problem you got is the Superpack trying to compile an older version of OpenCV.
When running the Superpack, you should have seen and redtext error, and if you try to run a code it should show you something like this:
File "C:\Python27\lib\site-packages\SimpleCV\base.py", line 59, in <module>
raise ImportError("Cannot load OpenCV library which is required by SimpleCV")
ImportError: Cannot load OpenCV library which is required by SimpleCV
There are a few paths you can try from there:
1. You can try to install Microsoft Visual C++ Compiler for Python 2.7
Uninstall everything SuperPack installed in your PC or it may not work
It may fixes some other uses when using pip.
Now you have to install SimpleCV again.
2. Try to install OpenCV(2.3) on your own:
You can use pip for it, just remember to chose 32bits to keep compatibility with (Super Pack)
Just run on CMD
pip install OpenCV or python -m pip install OpenCV
3. Give up on SuperPack and install everything on your own.
You can try this guide
https://github.com/sightmachine/SimpleCV#windows-7vista
Or use pip for all dependencies
numpy (Numpy+MKL make sure to install this one first)
scipy
PIL
ipython
svgwrite
pygame==1.9.1release
OpenCV
You can find a useful list of wheels here
http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
Sources:
https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/
http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
https://github.com/sightmachine/SimpleCV#windows-7vista

Categories