Skip to content Skip to sidebar Skip to footer

Cannot View Tiff Images In Kivy

problem I am able to load pictures with the Image() module in kivy. But for some reason, I can't load .tif files into kivy. When the image source is '..\pics\lugia.png', the image

Solution 1:

You need to create a proper installation I used anaconda to install kivy and I wasn't very thorough with installing the dependencies properly. So I had to create a fresh virtual python installation.

Note: This is for python version 3.5 or higher. Also I am going to have you explicitly state what python installation is going to be creating this environment. To my knowledge, there's no good reason to do this.

Windows

  1. (optional) find where python is installed for you. Start windows command prompt. C:\Users\H>pythonimport sys, osos.path.dirname(sys.executable) C:\Users\H\AppData\Local\Programs\Python\Python36 therefore, my python installation is at C:\Users\H\AppData\Local\Programs\Python\Python36\python
  2. Prepare a place for your new virtual environment. I created a folder called "venvs" in my home directory. C:\Users\H\venvs
  3. Create new virtual environment. I'll name mine "env1". Start windows command prompt. if you did step 1 C:\Users\H>C:\Users\H\AppData\Local\Programs\Python\Python36\python -m venv C:\Users\H\venvs\env1 if you did not do step 1 C:\Users\H>python -m venv C:\Users\H\venvs\env1
  4. Activate the new virtual environment C:\Users\H>C:\Users\H\venvs\env1\Scripts\activate
  5. Install dependencies (env1) C:\Users\H>python -m pip install docutils pygments pypiwin32 kivy_deps.sdl2==0.1.22 kivy_deps.glew==0.1.12
  6. Install kivy (env1) C:\Users\H>python -m pip install kivy==1.11.1
  7. PyCharm If you're using PyCharm, go to File>Settings From the settings menu Project>Project Interpreter Click the gear>Add In the Add Python Interpreter menu select 'Existing environment', then set the interpreter to the location of your new virtual environment.Mine was C:\Users\H\venvs\env1\Scripts\python.exe. Click Okay. Hit Apply in the settings menu. Once you hit okay, your script should be able to view TIFF files.

Post a Comment for "Cannot View Tiff Images In Kivy"