I tried to use a library (mapnik )and the python binding with it.
The library is installed at D:\install\gis\mapnik-v2.2.0
, then I add the following variable to the environment variable through the control panel:
PATH: D:\install\gis\mapnik-v2.2.0\bin;D:\install\gis\mapnik-v2.2.0\lib
PYTHONPATH:D:\install\gis\mapnik-v2.2.0\python\2.7\site-packages
Then I run:
python
>>import mapnik
This worked.
However, I do not want to set the variable to the global environment variable, so I tried to create a bat file like this:
setup_mapnik_path.bat:
SET mapnik_path=D:\install\gis\mapnik-v2.2.0;
SET PATH=%PATH%;%mapnik_path%\lib;%mapnik_path%\bin;
SET PYTHONPATH=%PYTHONPATH%;%mapnik_path%\python\2.7\site-packages;
Then once I tried to run a script who use mapnik I will run the bat first:
setup_mapnik_path.bat
python
>>import mapnik
But I will get error:
ImportError: No module named mapnik
Screenshot:http://pbrd.co/1lUk1F5
What's the problem?