6

I just installed the Liblas with pip:

C:\Users\Geri>pip install liblas
Requirement already satisfied (use --upgrade to upgrade): liblas in c:\python27\arcgis10.2\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\python27\arcgis10.2\lib\site-packages (from liblas)

when I want to import the module, I got the following:

>>> import liblas
Runtime error 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\ArcGIS10.2\lib\site-packages\liblas\__init__.py", line 2, in <module>
    from core import get_version
  File "C:\Python27\ArcGIS10.2\lib\site-packages\liblas\core.py", line 136, in <module>
    las = ctypes.CDLL(lib_name)
  File "C:\Python27\ArcGIS10.2\Lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

Please help

TigerhawkT3
  • 48,464
  • 6
  • 60
  • 97
Gary
  • 209
  • 1
  • 3
  • 13
  • Do you have a standard Python installation or a third-party distribution such as OSGeo4W or Anaconda? Pip installs it to the correct location for a standard install. – Dan Sep 24 '15 at 22:26
  • I use the 2.7 version of python which is installed with ArcGIS – Gary Sep 24 '15 at 22:28
  • If it was installed with ArcGIS, perhaps it created a different site-packages path other than the standard one for packages being imported into their software, or perhaps the environment variables were not set correctly for system path – Dan Sep 24 '15 at 22:28
  • I also installed the laspy module, which works perfectly. – Gary Sep 24 '15 at 22:30
  • [looks like you're not the only one running into this conflict/problem](http://stackoverflow.com/q/26479532/) – Dan Sep 24 '15 at 22:33
  • Yeah, unfortunately there is no answer there either :( – Gary Sep 24 '15 at 22:36
  • Did you install the liblas binary librarie (the DLL, I presume it is)? Can it be found? Because liblas is looking for something (sadly, it doesn't exactly show what: `self._name`...), loading it through ctypes, which is the interface to functions in binary libraries. –  Sep 24 '15 at 22:38
  • I simply used 'pip install liblas' in the cmd, so I don't really know where should I look it for – Gary Sep 24 '15 at 22:40

1 Answers1

0

My solution was to ensure that liblas.dll and liblas_c.dll were in the DLLs folder in all my python instances (I have python 2.7 in ArcGIS, OSGeo4W and WinPython).

I found the dll's in C:\Python27\ArcGIS10.2\DLLs after trying every method I could find for installing the liblas package (WinPython control panel, pip and installing using the exe from https://pypi.python.org/pypi/libLAS/1.6.0).

I have not tried using liblas via OSGeo4w as I am not sure where to put the dlls (I put them in the C:/OSgeo4w64/bin folder but that did not help) and OSgeo4w command_line package list in the installer tells me that liblas is not available. I also ensured that C:/OSgeo4w64/bin is in my path (as that was a suggestion above and elsewhere)... not sure if that helped.

All working fine now.

Steve
  • 11
  • 2