@@ -29,9 +29,13 @@ def checkversion(GEOS_dir):
29
29
# set GEOS_dir manually here if automatic detection fails.
30
30
GEOS_dir = None
31
31
32
+ user_home = os .path .expanduser ('~' )
33
+ geos_search_locations = [user_home , os .path .join (user_home , 'local' ),
34
+ '/usr' , '/usr/local' , '/sw' , '/opt' , '/opt/local' ]
35
+
32
36
if GEOS_dir is None :
33
37
# if GEOS_dir not set, check a few standard locations.
34
- GEOS_dirs = [ os . path . expanduser ( '~' ), '/usr' , '/usr/local' , '/sw' , '/opt' , '/opt/local' ]
38
+ GEOS_dirs = geos_search_locations
35
39
for direc in GEOS_dirs :
36
40
geos_version = checkversion (direc )
37
41
sys .stdout .write ('checking for GEOS lib in %s ....\n ' % direc )
@@ -47,13 +51,16 @@ def checkversion(GEOS_dir):
47
51
48
52
if GEOS_dir is None :
49
53
raise SystemExit ("""
50
- Can't find geos library . Please set the
51
- environment variable GEOS_DIR to point to the location
54
+ Can't find geos library in standard locations ('%s').
55
+ Please install the corresponding packages using your
56
+ systems software management system (e.g. for Debian Linux do:
57
+ 'apt-get install libgeos-3.3.3 libgeos-c1 libgeos-dev' and/or
58
+ set the environment variable GEOS_DIR to point to the location
52
59
where geos is installed (for example, if geos_c.h
53
60
is in /usr/local/include, and libgeos_c is in /usr/local/lib,
54
61
set GEOS_DIR to /usr/local), or edit the setup.py script
55
62
manually and set the variable GEOS_dir (right after the line
56
- that says "set GEOS_dir manually here".""" )
63
+ that says "set GEOS_dir manually here".""" % "', '" . join ( geos_search_locations ) )
57
64
else :
58
65
geos_include_dirs = [os .path .join (GEOS_dir ,'include' ),numpy .get_include ()]
59
66
geos_library_dirs = [os .path .join (GEOS_dir ,'lib' ),os .path .join (GEOS_dir ,'lib64' )]
0 commit comments