[MS4W-Users] error with command line tools after MS4W installation

Jeff McKenna jmckenna at gatewaygeomatics.com
Fri Feb 10 08:02:30 EST 2017


Thanks for the feedback Michael.  What is your results when you test 
with MS4W-4.0 alpha?  (with that you should be able to use your own 
Python 3.5.x with the normal steps / without editing setenv.bat)

My prediction is that Python users will be happy with MS4W-4.0.

-jeff


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




On 2017-02-10 4:50 AM, michael via MS4W-Users wrote:
> Dear Jeff,
>
> Thanks a lot for the time you spend for this very detailed explanation!
>
> Although I followed exactly your explanations I still get the same error
> though.
>
> Here the output of my command shell (I use Windows 10):
> (as you see I did a slightly different change of setenv.bat, I didn't
> add the MS4W path to my path, but only use the MS4W path, otherwise the
> output below would look ugly)
>
> Microsoft Windows [Version 10.0.10586]
> (c) 2015 Microsoft Corporation. All rights reserved.
>
> C:\Users\michael>cd ..\..\ms4w
>
> C:\ms4w>setenv.bat
> GDAL, mapserv, and commandline MS4W tools path set
> C:\ms4w>path
> PATH=C:\ms4w;C:\ms4w\Apache\cgi-bin;C:\ms4w\tools\gdal-ogr;C:\ms4w\tools\mapserv;C:\ms4w\tools\shapelib;C:\ms4w\proj\bin;C:\ms4w\tools\shp2tile;C:\ms4w\tools\shpdiff;C:\ms4w\tools\avce00;C:\ms4w\gdalbindings\python\gdal;C:\ms4w\tools\php;C:\ms4w\tools\mapcache;C:\ms4w\tools\berkeley-db;C:\ms4w\tools\sqlite;C:\ms4w\tools\spatialite;C:\ms4w\tools\unixutils;C:\ms4w\tools\openssl;\ms4w\Python;
>
>
> C:\ms4w>python
> Python 2.7.13 (default, Jan 18 2017, 12:56:32) [MSC v.1700 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> quit()
>
> C:\ms4w>cd gdalbindings\python\gdal\
>
> C:\ms4w\gdalbindings\python\gdal>python gdal_merge.py
> Traceback (most recent call last):
>   File "gdal_merge.py", line 37, in <module>
>     from osgeo import gdal
>   File "C:\ms4w\gdalbindings\python\gdal\osgeo\__init__.py", line 21, in
> <module>
>     _gdal = swig_import_helper()
>   File "C:\ms4w\gdalbindings\python\gdal\osgeo\__init__.py", line 17, in
> swig_import_helper
>     _mod = imp.load_module('_gdal', fp, pathname, description)
> ImportError: DLL load failed: The specified procedure could not be found.
>
> C:\ms4w\gdalbindings\python\gdal>
>
> Thanks for your help,
>
> Michael
>
> On 09.02.2017 16:35, Jeff McKenna via MS4W-Users wrote:
>> Hi Michael,
>>
>> (sorry for the long email that following, but it is necessary to
>> explain fully)
>>
>> If you are using MS4W 3.2.0, that is compiled for Python 2.7.13;
>> however to be honest, if you are a Python user you should be migrating
>> to MS4W 4.0 as it supports both Python 3.x and PHP 7.x (which is
>> available for testing and feedback in an Alpha release at
>> http://www.ms4w.com/release/experimental/).  There is an awkward
>> problem now of supporting both Python and PHP 5.6, and the versions of
>> compilers they support (there was a long discussion of this in an MS4W
>> ticket at http://ms4w.com/trac/ticket/74).
>>
>> However I did see this issue coming: so if you are using MS4W 3.2.0,
>> it actually includes a custom Python 2.7.13 build (python.exe), in
>> hopes to help this unfortunate situation for the short term.  So here
>> are the steps (I admit they are not easy, but, until MS4W 4.0 comes
>> along it is a workaround):
>>
>>  - edit in a text editor: setenv.bat
>>
>>  - on line #7, add "\ms4w\Python;" before the "%PATH" near the end of
>> that line
>>
>>  - open a new Command Prompt window
>>
>>  - cd into ms4w
>>
>>  - execute: setenv.bat
>>
>>  - execute: python
>>
>>      (you should see python 2.7.13 usage)
>>
>>  - cd into \gdalbindings\python\gdal\
>>
>>  - execute: python gdal_merge.py
>>
>>      (you should see the gdal_merge usage)
>>
>>
>> So in the perfect world we will all soon switch to MS4W 4.0 (the
>> compiler for that supports both Python 3.5 and PHP 7); but it is a
>> little early, even though I am trying very hard to get there - if your
>> organization can help fund that along please contact me directly and
>> then the whole MS4W community benefits.  Or if you need a custom build
>> sooner than that (such as for Python 2.x with latest libraries) please
>> also contact me directly.
>>
>> But please be aware that MS4W 4.0 is the future and it is coming (with
>> Python 3 and PHP 7 support working nicely - that is the goal!).
>>
>> That ticket that I referenced explains the confusing situation the best.
>>
>> If you find problems please do file your tickets direct in the MS4W
>> tracker: http://ms4w.com/trac/  If you cannot provide funding to
>> produce the great MS4W that you organization needs, then you can for
>> sure provide feedback and testing through the MS4W tracker :)
>>
>> Thanks,
>>
>> -jeff
>>
>
> _______________________________________________
> MS4W-Users mailing list
> MS4W-Users at lists.ms4w.com
> https://lists.ms4w.com/mailman/listinfo/ms4w-users





More information about the MS4W-Users mailing list