fix PYTHONHOME in order to import liblas module in Python

665 Views Asked by At

I have the following error message on windows 64-bit and Python 2.7.

the liblas module version is libLAS-1.7.0.win-amd64-py2.7.‌exe

import liblas
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python27\lib\site-packages\liblas\__init__.py", line 2, in <module>
    from core import get_version
  File "C:\Python27\lib\site-packages\liblas\core.py", line 138, in <module>
    las = ctypes.CDLL(os.path.join(local_dlls, lib_name))
  File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application

The module is installed in

C:\Python27\Lib\site-packages\liblas

i used this module several times (it's a core module of my work), but today i have this problem. I unistalled liblas, reinstalled, unistalled all Python and all modules, and reinstall everything bit i have always the same problem.

1

There are 1 best solutions below

1
On

If you have 64-bit version of Python installed and LibLAS dll 32-bit, then you can get this type of error. If so, then you can find 64-bit version of this library on this site (there are actually a lot of other 32-bit and 64-bit libraries for Python).