[Mapserver-users] Installing Python Mapscript

Sean Gillies sgillies at frii.com
Thu Jul 29 11:59:05 PDT 2004


On Jul 29, 2004, at 12:44 PM, William Hudspeth wrote:

> Thanks for responding Sean,
> I have searched my machine and simply cannot find the _mapscript.so 
> you mention. It is possible it was inadvertantly removed by someone 
> working on our systems, or never installed correctly in the first 
> place. Where can I download a new version of the package for Linux?
>
> Thanks, Bill
>
>
>
>
>
> Sean Gillies wrote:
>
>> On Jul 29, 2004, at 11:08 AM, William Hudspeth wrote:
>>
>>> Hello all,
>>>
>>> I am trying to install Python Mapscript. I have run "python setup.py 
>>> install" in the /mapscript/python directory. When I try to import 
>>> mapscript,
>>>
>>> >>>import mapscript
>>>
>>>
>>> I get :
>>>
>>> ImportError: No module named _mapscript
>>>
>>> What might be the problem?
>>>
>>> Thanks, Bill
>>>
>>
>> Bill,
>>
>> Here's my first guess at the problem, a gotcha that I've experienced.
>>
>> The mapscript module is configured in such a way that the
>> Python interpreter expects to find both mapscript (aka mapscript.py)
>> and _mapscript (aka _mapscript.so or _mapscript.pyd) side-by-side
>> somewhere in your PYTHONPATH.
>>
>> After the install, mapscript.py and _mapscript.so (I'm assuming linux)
>> are copied to /usr/lib/python/lib/site-packages or something like 
>> that.
>> However, the current working directory remains at the head of your
>> PYTHONPATH.  This allows modules in your working directory to override
>> installed modules.
>>
>> At any rate, change directory to any other location, and try again
>> to import mapscript -- you'll get the installed modules.
>>
>> cheers,
>> Sean
>>
>> -- 
>> Sean Gillies
>> sgillies at frii dot com
>> http://users.frii.com/sgillies
>>
>>

Alright, let's start over.  Can you post the terminal output you 
received
after running "python setup.py install"?

Sean




More information about the MapServer-users mailing list