Trouble opening Biodiverse - alien? URGENT

121 views
Skip to first unread message

Filipe Alexandre Cabreirinha Serrano

unread,
May 14, 2021, 6:15:24 PM5/14/21
to Biodiverse Users
Hi Shawn and everyone,

I'm using Biodiverse 3.1 on Windows 10 x64

I have used Biodiverse for a while but updated recently to 3.1 to import shapefiles.

Initially, I had some trouble importing shapefiles, with an error message reading "ERROR 1: PROJ: proj_create_from_wkt: Cannot find proj.db". This was eventually solved by entering:
setx GDAL_DATA "C:\Program Files\GDAL\gdal-data" 
 setx GDAL_DRIVER_PATH "C:\Program Files\GDAL\gdalplugins" 
setx PROJ_LIB "C:\Program Files\GDAL\projlib" 
 setx PYTHONPATH "C:\Program Files\GDAL\" in the command prompt.

I used it for two days and suddenly I was unable to use neither the executable version nor running it from the command line. I get the following error:
C:\Program Files (x86)\biodiverse_3.1_win>BiodiverseGUI.exe
Cannot find either a share directory or a ConfigData module for Alien::geos::af.
(Alien::geos::af loaded from C:\Users\filse\AppData\Local\Temp\par-66696c7365\cache-d5ad0a79ca63404357475eff1a5034d1ffb62add\inc\lib/Alien/geos/af.pm)
Can't locate Alien/geos/af/ConfigData.pm in @INC (you may need to install the Alien::geos::af::ConfigData module) (@INC contains: C:\Program Files (x86)\lib C:\Program Files (x86)\biodiverse_3.1_win\lib C:\Users\filse\AppData\Local\Temp\par-66696c7365\cache-d5ad0a79ca63404357475eff1a5034d1ffb62add\inc\lib C:\Users\filse\AppData\Local\Temp\par-66696c7365\cache-d5ad0a79ca63404357475eff1a5034d1ffb62add\inc CODE(0x374dfb0) CODE(0x3758688)) at Alien/Base.pm line 347.
BEGIN failed--compilation aborted at Alien/gdal.pm line 44.
Compilation failed in require at Biodiverse/Config.pm line 232.
BEGIN failed--compilation aborted at Biodiverse/Config.pm line 232.
Compilation failed in require at script/BiodiverseGUI.pl line 30.
BEGIN failed--compilation aborted at script/BiodiverseGUI.pl line 30.

I have not installed any software between getting Biodiverse to import shapefiles and this sudden error, and I have tried to solve this by running "cpanm Alien::geos::af" in my command line, to no avail: "Alien::geos::af is up to date. (1.007)".

I truly have no idea has to solve this URGENT matter (have to send a report with the output very very soon) and I am a bit out of my depth. 

Any ideas to solve this issue?

Thank you in advance, BIG fan of Biodiverse
Fil


Shawn Laffan

unread,
May 14, 2021, 6:58:10 PM5/14/21
to biodiver...@googlegroups.com
Hello Fil,

I suspect there is an interaction between the GEOS libs that are bundled inside the Biodiverse executable, and another set of libs that are on your system. 

Some debugging steps to try are below.  Can you post what effect they have?

1.
Delete the directory C:\Users\filse\AppData\Local\Temp\par-66696c7365\
This directory contains the unpacked contents of the Biodiverse executable, and will be repopulated the next time you run it.  Deleting it is to remove any potential external files being placed there (unlikely, but always possible). 

2.
Make sure you have no GDAL/Proj/Geos environment variables set when you are calling Biodiverse. 

set GDAL_DATA=
set GDAL_DRIVER_PATH=
set PROJ_LIB=
set PYTHONPATH=
./BiodiverseGUI.exe

3.
Check your path to see where your system GDAL is in the sequence.  The Alien modules might need to override these to avoid any interactions.  If this is the case then a workaround is to edit the path in the cmd session to remove them (e.g. via a batch file).

Regards,
Shawn.
--
You received this message because you are subscribed to the Google Groups "Biodiverse Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biodiverse-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biodiverse-users/ab4e1051-b094-47ea-bcd8-254bce8acda3n%40googlegroups.com.

Filipe Serrano

unread,
May 17, 2021, 10:44:23 AM5/17/21
to biodiver...@googlegroups.com
Dear Shawn, thank you for your prompt response!

With the first step alone, I was able to run BiodiverseGUI directly from the .exe, and it ran smoothly. Thank you, that was excellent and very helpful!

However, I am still getting "PROJ: proj_create_from_wkt: Cannot find proj.db" in other computers and I am still unsure what to do to solve this issue. Even on my main computer (the one with the previous issue) I am getting this error message after setting the environmental variables as suggested (step 2: "set GDAL_DATA= (...)"). Again, it may also be due to me copying the "Biodiverse" folder to a more friendly location (perhaps confusing the PATH). I did not test step 3 because step 1 completely solved the first issue.

What would you think is the solution for the "PROJ: proj_create_from_wkt: Cannot find proj.db"?

Thank you once again, Shawn!

Fil
____________________________________________
Filipe Serrano

Ph.D. Student in Terrestrial Ecology
Department of Ecology, 
Universidade de São Paulo, Brasil



Virus-free. www.avg.com


Virus-free. www.avg.com

Shawn Laffan

unread,
May 17, 2021, 5:53:35 PM5/17/21
to biodiver...@googlegroups.com
Hello Fil,

Moving the Biodiverse folder should not affect things.  It is still unpacked to the same location, which is where it should then be looking for the proj.db file. 

I suspect this issue is caused by another proj installation that is in your path.  This is being picked up in the search for dynamic libraries, and then things go wrong.  (For people not sure what the path is, it is the sequence of folders in which Windows will look for executables, dynamic link libraries and the like). 

What happens if you remove C:\Program Files\GDAL from your path? 

To get the path you can type path in the cmd window. 

Then use a text editor to edit the text it returns, removing C:\Program Files\GDAL; .  Then, setting the path to be the edited path string in a cmd prompt (substitute the edited path for your_new_path_string):

set PATH=your_new_path_string
.\BiodiverseGUI.exe


Be sure to use set and not setx - you do not want to override your path at the system level.  You only want to change it in this cmd window. 

If that does not work then the further workaround is to set the PROJ_LIB variable to point to the unpacked Biodiverse proj.db location.  This is obviously not something users should need to do, but it will help with debugging.

set PROJ_LIB=C:\Users\filse\AppData\Local\Temp\par-66696c7365\cache-d5ad0a79ca63404357475eff1a5034d1ffb62add\inc\lib\auto\share\dist\Alien-proj\share
BiodiverseGUI.exe


Once we understand what is going on then I can update the Biodiverse code so users do not need to do any of the above. 

Regards,
Shawn.

Filipe Serrano

unread,
May 18, 2021, 12:13:41 AM5/18/21
to biodiver...@googlegroups.com
Hello Shawn, thank you

So, C:\Program Files\GDAL was not in my path (it does not appear with path in the cmd window nor is it in the 'user variables').

I tried the " set PROJ_LIB " (was it supposed to end with 'share' or 'proj', since "proj_db" is in the 'proj' folder?), but it did not work either.
After both steps and trying to run Biodiverse from the cmd (".\BiodiverseGUI.exe"), Windows tells me "This app can't run on your PC" which is really odd since I could run it directly from there before. What should I try next?

Best regards,
Fil
____________________________________________
Filipe Serrano

Ph.D. Student in Terrestrial Ecology
Department of Ecology, 
Universidade de São Paulo, Brasil



Virus-free. www.avg.com

Shawn Laffan

unread,
May 18, 2021, 12:35:52 AM5/18/21
to biodiver...@googlegroups.com
Hmm.  What result do you get when you type these commands?

where gdalwarp

where projinfo


As for the other error, you might need to clean up the cache directory again.  Are you running something like ccleaner on a regular basis?  It has been known in the past to delete the files needed by Biodiverse, and perhaps the solutions put in place to avoid that issue aren't general enough.

Shawn.

Filipe Serrano

unread,
May 18, 2021, 11:06:47 AM5/18/21
to biodiver...@googlegroups.com
Hi Shawm,

Here's what those commands return:

C:\Users\filse>where gdalwarp
C:\OSGeo4W64\bin\gdalwarp.exe

C:\Users\filse>where projinfo
C:\OSGeo4W64\bin\projinfo.exe

I am not running ccleaner on a regular basis but I recently did some light maintenance (deleted some temporary files/Windows expired updates via Disk Cleanup) to free up some space on my disk. This was after the "PROJ: proj_create_from_wkt: Cannot find proj.db", though.

Fil
____________________________________________
Filipe Serrano

Ph.D. Student in Terrestrial Ecology
Department of Ecology, 
Universidade de São Paulo, Brasil



Virus-free. www.avg.com

Filipe Serrano

unread,
May 18, 2021, 1:10:27 PM5/18/21
to biodiver...@googlegroups.com
Hi Shawn, 

Just adding some more (hopefully helpful) information, the full message is:

PROJ: proj_identify: Cannot find proj.db
PROJ: proj_as_wkt: Cannot find proj.db at Geo/GDAL/FFI.pm line 1374.
Geo::GDAL::FFI::Open("G:\\Shared drives\\Gondwana\\ranges\\impacted
species\\spp_pampas_"...) called at Biodiverse/GUI/BasedataImport.pm line 744
eval {...} called at Biodiverse/GUI/BasedataImport.pm line 743
Biodiverse::GUI::BasedataImport::run(Biodiverse::GUI::GUIManager=HASH(0x8280098))
called at Biodiverse/GUI/GUIManager.pm line 665
eval {...} called at Biodiverse/GUI/GUIManager.pm line 665
Biodiverse::GUI::GUIManager::do_import(Biodiverse::GUI::GUIManager=HASH(0x8280098))
called at Biodiverse/GUI/Callbacks.pm line 64
eval {...} called at Biodiverse/GUI/Callbacks.pm line 62
Biodiverse::GUI::Callbacks::__ANON__(Gtk2::Action=HASH(0x11fd5c80), undef)
called at script/BiodiverseGUI.pl line 106
eval {...} called at script/BiodiverseGUI.pl line 106
require main called at C:/berrybrew/5.28.0_64_PDL/perl/site/lib/PAR.pm line 647
PAR::_run_member(Archive::Zip::ZipFileMember=HASH(0x3f1fc70), 1) called at
script/main.pl line 26
require main called at C:/berrybrew/5.28.0_64_PDL/perl/site/lib/PAR.pm line 647
PAR::_run_member(Archive::Zip::ZipFileMember=HASH(0x3f22fc0)) called at
C:/berrybrew/5.28.0_64_PDL/perl/site/lib/PAR.pm line 434
PAR::import("PAR") called at -e line 595
eval {...} called at -e line 42
__par_pl::BEGIN() called at script/BiodiverseGUI.pl line 0
eval {...} called at script/BiodiverseGUI.pl line 0
 at Biodiverse/GUI/GUIManager.pm line 665.

Cheers and thank you!

____________________________________________
Filipe Serrano

Ph.D. Student in Terrestrial Ecology
Department of Ecology, 
Universidade de São Paulo, Brasil



Virus-free. www.avg.com

Shawn Laffan

unread,
May 18, 2021, 5:56:06 PM5/18/21
to biodiver...@googlegroups.com
Thanks for those details.  An interaction with OSGEO4W looks likely to be the cause of the problem, as that system also provides DLLs for gdal, proj and geos.

Can you try running the path edit again, but this time remove C:\OSGeo4W64\bin?  Also remove any other paths containing C:\OSGeo4W64 subfolders. 


Regards,
Shawn.

Filipe Serrano

unread,
May 18, 2021, 8:12:22 PM5/18/21
to biodiver...@googlegroups.com
Removing all paths containing C:\OSGeo4W64 did the job, Biodiverse is running smoothly!
For future reference, my PROJ_LIB is C:\OSGeo4W64\share\proj.

I tried to do the same on a different computer (that had both C:\OSGeo4W64\ and C:\Program Files\GDAL\ in PATH) but it did not work there. 
My problem is solved (as I will be using only the computer where it worked) but if you have any other suggestions to solve this issue (mainly for people who might have this issue in the future), I will be happy to hear them too.

I really appreciate the time and effort, Shawn, thank you!

All the best,
Fil
____________________________________________
Filipe Serrano

Ph.D. Student in Terrestrial Ecology
Department of Ecology, 
Universidade de São Paulo, Brasil



Virus-free. www.avg.com

Shawn Laffan

unread,
May 19, 2021, 6:42:38 AM5/19/21
to biodiver...@googlegroups.com
Thanks for confirming Fil. 

This is an issue that will potentially affect many users, so I have opened a new issue so it will be addressed in the next release.  That issue also contains a potentially simpler workaround that avoids the need for a text editor every time it is needed. 

https://github.com/shawnlaffan/biodiverse/issues/795

As for the other machines, it might be the same issue, but that gdal is in more folders.  The ```where libgdal*.dll``` command will help here (I should have recommended this file before as it is a more direct search than gdalwarp.exe).

Regards,
Shawn.

Shawn Laffan

unread,
Nov 21, 2021, 7:58:15 PM11/21/21
to biodiver...@googlegroups.com
Hello Fil,

The most recent development releases contain a potential fix to the problem (Biodiverse removes the extra paths itself when it starts).

Can you please give version 3.99_001  or 3.99_002 a try? 

https://github.com/shawnlaffan/biodiverse/releases/

Thanks,
Shawn.
Reply all
Reply to author
Forward
0 new messages