global name 'os' is not defined See log for more details

2,319 views
Skip to first unread message

Cristian La Rosa

unread,
Nov 2, 2014, 3:51:59 PM11/2/14
to last...@googlegroups.com
Hello everyone:


   I am new to QGIS and to LAStools. I was recently able to install the LAStool toolbox in QGIS. But after trying to run lasground, using the fuza.laz file from the data folder. I keep getting an error message that says the following

Algorithm lasground starting...

global name 'os' is not defined See log for more details


can anyone help me?



Thank you


Cristian

 

omer...@eltemtek.com

unread,
Nov 17, 2014, 6:50:22 AM11/17/14
to last...@googlegroups.com
Hello All;

I am having the same problem. Does anyone has the same problem and the solution for that? 

Cheers

2 Kasım 2014 Pazar 22:51:59 UTC+2 tarihinde Cristian La Rosa yazdı:

Antonio Ruiz

unread,
Nov 18, 2014, 3:11:52 AM11/18/14
to last...@googlegroups.com
In my case the environment variable OS is set to Windows_NT. I have installed QGIS on OSGeo4W. If you are working with Windows, OSGeo4W takes care of all of the settings. 

Jorge García Tíscar

unread,
Nov 18, 2014, 8:20:39 AM11/18/14
to last...@googlegroups.com
I'm having the same error, QGIS 2.6.0-Brighton installed through OSGeo4W. My OS environment variable is set to Windows_NT:

C:\>echo %OS%
Windows_NT

LAStools bins appear to work correctly on its own (i.e. directly executing lasview.exe from its folder).

Cheers!

Richard C

unread,
Dec 15, 2014, 11:28:43 AM12/15/14
to last...@googlegroups.com
I'm afraid I have the same problem. I posted details and a question in the QGIS StackExchange (http://gis.stackexchange.com/questions/125116/problem-operating-lastools-in-qgis-2-6-1).

Martin Isenburg

unread,
Dec 17, 2014, 6:58:37 AM12/17/14
to last...@googlegroups.com, Victor Olaya
Hello LAStools via QGIS users,

I have yet to download and install QGIS 2.6 myself. Has anyone been able to run LAStools successfully via QGIS 2.6 or is this error 

global name 'os' is not defined See log for more details

universal to all attempts to run LAStools via QGIS 2.6 Processing installations? I am CC-ing Victor Olaya - the brain behind the QGIS Processing framework - on this.

Regards,

Martin 

PS: There was a comment in the QGIS StackExchange about using LAS instead of LAZ. I can assure you that this will not help. LAStools does run no matter if your input is LAS, LAZ, BIL, DTM, ASC, BIN, PTS or plain ASCII. The issue would have to be a change in the Python Scripting of Processing that has not yet been propagates into the LAStools scripts ...

Drexel Peter

unread,
Dec 17, 2014, 9:55:38 AM12/17/14
to last...@googlegroups.com, vol...@gmail.com
Martin,
at least for me it works on QGIS 2.6.1 in Windows 7 64 bit.
I tried lasview lasboundry and lasground.
I use the lastools dated from 2014-08-22, having the lastools-Folder here:  D:\Software\LasTools\2014-05\lastools.
In QGIS-Processing-Options and Configuration-Provider-Tools for Lidar Data - the Lastools-Folder is set to the above location.
the System variable os is set "OS=Windows_NT".
Thanks
Peter

Kelly Ness

unread,
Dec 20, 2014, 10:41:54 PM12/20/14
to last...@googlegroups.com
I have the same error.  Please let me know where to find the setting to "define the os"

Thanks!

Kelly

Tomáš Svárovský

unread,
Dec 25, 2014, 4:21:40 PM12/25/14
to last...@googlegroups.com
I had the same problems with QGIS 2.6.1 and LAStools - "global name 'os' is not defined..."

I tried many things and helped me following:

Although the lastoolbox is already installed in 2.6.1, download newest version from this address: http:\\lastools.org\download\lastools.zip
Extract this file and copy folder "LAStools" somwhere. Path to this folder must not contain gaps, diacritic.........example: c:\q gis\LAStools........is wrong, c:\q_gis\LAStools.......is ok :)

Extract file "QGIS_2_4_toolbox.zip" from "LAStools\QGIS_toolbox" ...........the name of the folder will be "processing" and replace with original folder in your system.............example: C:\QGIS_Brighton\apps\qgis\python\plugins\processing
Set the path to "LAStools" folder in QGIS>processing>option and configuration>tools for LiDAR data>LAStools folder

Hope it will help...

Tomas
 

Nath_Shaw

unread,
Feb 24, 2015, 6:26:20 PM2/24/15
to last...@googlegroups.com
Hi All,

I found the answer to this problem posted here: 
http://osgeo-org.1560.x6.nabble.com/Problems-running-LAStools-in-2-6-1-td5179484.html

Refer the post from Salvatore Larosa-2

In this post he advises [paraphrasing]:
"edit the file
python/plugins/processing/algs/lidar/lastools/LAStoolsUtils.py
add the missing import module.
You can do this by adding "import os" just after or before "import
subprocess"


I edited the file as advised by Salvatore Larosa-2,   No more global name 'os' is not defined error. Lastools is now working for me in Qgis 2.6.1 Brighton.

Regards,
Nathan



Axel

unread,
Mar 1, 2015, 9:55:52 AM3/1/15
to last...@googlegroups.com
Thanks for the workaround but I can neither find python/plugins/processing/algs/lidar/lastools/ nor the file python/plugins/processing/algs/lidar/lastools/LAStoolsUtils.py 

Any idea where I might find it?

Thanks,

Axel

Adam Erickson

unread,
Apr 10, 2015, 9:00:09 PM4/10/15
to last...@googlegroups.com
Axel, you can find these under the following directory, assuming a Windows 64-bit installation:

C:\Program Files\QGIS Wien\apps\qgis\

Within the 'processing' folder you installed from LAStools into QGIS, it corresponds to:

\algs\lidar\lastools\LAStoolsUtils.py

Adam
Reply all
Reply to author
Forward
0 new messages