2

CMake fails to configure. I get following error:

Could NOT find PythonInterp: Found unsuitable version "1.4", but required
is at least "2.7" (found c:/cygwin/bin/python2.7.exe)

which seems irrational. Probably I have found a cause of this behavior. I think that there is a problem with bat file found in the instruction:

@echo off
set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\
call "%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86

set INCLUDE=%INCLUDE%;%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\include
set LIB=%LIB%;%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\lib

set OSGEO4W_ROOT=C:\OSGeo4W
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
path %PATH%;%PROGRAMFILES%\CMake\bin;c:\cygwin\bin

@set GRASS_PREFIX=c:/OSGeo4W/apps/grass/grass-6.4.4
@set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
@set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib

@cmd

If I run the bat file and run c:/cygwin/bin/python2.7.exe in cmd I get the following error message:

ImportError: No module named site

Running c:/cygwin/bin/python2.7.exe in cmd without running bat file works fine.

I have found answers to similar questions but none solves my problem. Please help me. What can I change in bat file to make it work?

2

What worked for me was clearing PYTHONHOME variable. So modified bat I used look like this:

@echo off
set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\
call "%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86

set INCLUDE=%INCLUDE%;%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\include
set LIB=%LIB%;%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\lib

set OSGEO4W_ROOT=C:\OSGeo4W
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
path %PATH%;%PROGRAMFILES%\CMake\bin;c:\cygwin\bin

@set GRASS_PREFIX=c:/OSGeo4W/apps/grass/grass-6.4.4
@set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
@set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib

SET PYTHONHOME=

@cmd

I will mark this answer as accepted as it worked for me. However if anyone knows the problem and has better answer I would be happy to get to know it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.