[GRASS-user] Error in pansharp tool: missing grass.script

Andrea Peri aperi2007 at gmail.com
Wed Jun 24 23:58:13 PDT 2015


Hi Vaclav,,

I send the results of tests:

outside from grass:

python -c "import grass.script as grass"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named grass.script

-----------------------------------------
outside from grass:
python -c "import grass"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named grass

-----------------------------------------

outside from grass:
python -c "import sys; print(sys.path)"

['', '/usr/local/lib/python2.7/dist-packages/GDAL-2.0.0-py2.7-linux-x86_64.egg',
'/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PIL',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']

-----------------------------------------

inside grass:

python -c "import grass.script as grass"
(no error)

python -c "import grass"
(no error)

python -c "import sys; print(sys.path)"
['', '/usr/local/lib/python2.7/dist-packages/GDAL-2.0.0-py2.7-linux-x86_64.egg',
'/usr/local/grass-7.0.0/etc/python',
'/usr/local/grass-7.0.0/gui/wxpython', '/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PIL',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']
GRASS 7.0.0 (toscana_location):/home/archivio/dati/raster/landsat/applicazione >


Regards,

A.

2015-06-24 23:47 GMT+02:00 Vaclav Petras <wenzeslaus at gmail.com>:
>
>
> On Wed, Jun 24, 2015 at 3:18 PM, Andrea Peri <aperi2007 at gmail.com> wrote:
>>
>> Hi,
>>
>> python --version =>2.7.3
>> my system is a Debian 7 64bit.
>>
>> I remove the PYTHONPATH and try the changed as you suggest.
>> but the error is still here.
>>
>> Traceback (most recent call last):
>>   File "/usr/local/grass-7.0.0/scripts/i.pansharpen", line 91, in <module>
>>     import grass.script as gscript
>> ImportError: No module named grass.script
>>
>> The variable should not removed because otherwise is not founded the
>> folders grass/script
>>
>> Meanwhile I notice the same issue "No module named grass.script" is
>> also in i.colors.enhance
>
>
> Please try also this commands:
>
> python -c "import grass.script as grass"
> python -c "import grass"
>
> inside and outside of GRASS. This should find out if there is some other
> package called grass.
>
> Also find out Python version in and outside GRASS and run also
>
> python -c "import sys; print(sys.path)"
>
> inside and outside of GRASS.
>
> It seems that PYTHONPATH=/usr/local/grass-7.0.0/etc/python is not set in
> GRASS but it should be set automatically during the start, so something is
> wrong.
>
>
>> Andrea.
>>
>>
>> 2015-06-24 15:26 GMT+02:00 Vaclav Petras <wenzeslaus at gmail.com>:
>> >
>> > On Wed, Jun 24, 2015 at 9:18 AM, Andrea Peri <aperi2007 at gmail.com>
>> > wrote:
>> >>
>> >> Hi Vaclav,
>> >> thx for help.
>> >>
>> >> I have no problem to try your patch,
>> >>
>> >> If I understand , I should remove the
>> >> env var PYTHONPATH and return to previous situation before try your
>> >> patch
>> >> ?
>> >
>> >
>> > Yes and you should also try
>> >
>> > python --version
>> >
>> > and
>> >
>> > python -c "import grass.script as grass"
>> >
>> > from command line in GRASS.
>> >
>> > What is your system?
>>
>>
>>
>> --
>> -----------------
>> Andrea Peri
>> . . . . . . . . .
>> qwerty àèìòù
>> -----------------
>
>



-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------


More information about the grass-user mailing list