Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Thursday, August 31, 2017

TileCache : Cannot Identify Image File

On a newly set up CentOS box, and newly installed TileCache, i got this:

Last lines says:
File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 2030, in open
    raise IOError("cannot identify image file")

I tried replacing PIL with Pillow but still got an error. I had successful installations on other CentOS boxes before, so PIL should work. After removing Pillow, I reinstalled PIL... then, that's it! It worked! Must have had an issue when I installed PIL the first time.

Solution:

        Reinstall PIL:
               install pip
                        # sudo yum install python-pip

               uninstall PIL
                        # sudo pip uninstall PIL

               reinstall PIL Imaging
                        # cd Imaging-1.1.6
                        # sudo python setup.py install

Wednesday, October 19, 2016

Windows Server : Python : Running Background Scripts without Console

We have a Windows Server that runs a python script every minute to send stats to a time-series-platform. So, every minute, we see a window that pops-up and disappears in a fraction of a second. If you access your server a lot, that's kinda irritating, so we had to run the python script without the console.

To run a python script without the console (popping-up):

  1. Save your python script with a .pyw extension (instead of .py)
  2. Run pythonw.exe (instead of python.exe)
Now, let's see if we'll miss that irritating console that's been playing eye tricks on us. :D

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...