1

I am a newbie, trying to import a NetCDF file of satellite chlorophyll imagery into QGIS 3.8 (WIndows Standalone install).

I have added the raster layer and view the individual layers under "properties".
I would like to use the time manger plugin to view a basic time series.
I try to add the raster (.nc) from the time manager settings and check the "layer is NetCDF file with time dimension".
QGIS returns a message that I need to pip install netCDF for full support.

I have tried to do this but with the error log below:

C:\Program Files\QGIS 3.8>py3_env

C:\Program Files\QGIS 3.8>SET PYTHONPATH=

C:\Program Files\QGIS 3.8>SET PYTHONHOME=C:\PROGRA~1\QGIS3~1.8\apps\Python37

C:\Program Files\QGIS 3.8>PATH C:\PROGRA~1\QGIS3~1.8\apps\Python37;C:\PROGRA~1\QGIS3~1.8\apps\Python37\Scripts;{app};C:\PROGRA~1\QGIS3~1.8\apps\Python27\Scripts;C:\PROGRA~1\QGIS3~1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem;C:\Program Files\R\R-3.5.2\bin\x64

C:\Program Files\QGIS 3.8>pip3 install netCDF
Collecting netCDF
  Downloading https://files.pythonhosted.org/packages/dc/86/8f8e1b532a24f18d0487cd2a95c50ca7f1c41bc58bbba2d4bd6a9ce0fac9/netcdf-0.2.1.tar.gz (16.5MB)
     |████████████████████████████████| 16.5MB 2.2MB/s
Collecting numpy==1.8.0 (from netCDF)
  Downloading https://files.pythonhosted.org/packages/73/46/c5b5c61fccec607dad15a2d1f832dec1a8d094ea770d8f8e4a43abd8be7b/numpy-1.8.0.tar.gz (3.8MB)
     |████████████████████████████████| 3.8MB 656kB/s
    ERROR: Command errored out with exit status 1:
     command: 'c:\osgeo4~1\bin\python3.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\drsno\\AppData\\Local\\Temp\\pip-install-w4_kbhro\\numpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\drsno\\AppData\\Local\\Temp\\pip-install-w4_kbhro\\numpy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: C:\Users\drsno\AppData\Local\Temp\pip-install-w4_kbhro\numpy\
    Complete output (118 lines):
    'svnversion' is not recognized as an internal or external command,
    operable program or batch file.
    non-existing path in 'numpy\\distutils': 'site.cfg'
    F2PY Version 2
    blas_opt_info:
    blas_mkl_info:
      libraries mkl,vml,guide not found in ['C:\\PROGRA~1\\QGIS3~1.8\\apps\\Python37\\lib', 'C:\\']
      NOT AVAILABLE

    openblas_info:
      libraries openblas not found in ['C:\\PROGRA~1\\QGIS3~1.8\\apps\\Python37\\lib', 'C:\\']
      NOT AVAILABLE

    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in ['C:\\PROGRA~1\\QGIS3~1.8\\apps\\Python37\\lib', 'C:\\']
      NOT AVAILABLE

    atlas_blas_info:
      libraries f77blas,cblas,atlas not found in ['C:\\PROGRA~1\\QGIS3~1.8\\apps\\Python37\\lib', 'C:\\']
      NOT AVAILABLE

    blas_info:
      libraries blas not found in ['C:\\PROGRA~1\\QGIS3~1.8\\apps\\Python37\\lib', 'C:\\']
      NOT AVAILABLE

    blas_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    'svnversion' is not recognized as an internal or external command,
    operable program or batch file.
    non-existing path in 'numpy\\lib': 'benchmarks'
    lapack_opt_info:
    lapack_mkl_info:
    mkl_info:
      libraries mkl,vml,guide not found in ['C:\\PROGRA~1\\QGIS3~1.8\\apps\\Python37\\lib', 'C:\\']
      NOT AVAILABLE

      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib
      libraries lapack_atlas not found in C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib
      libraries ptf77blas,ptcblas,atlas not found in C:\
      libraries lapack_atlas not found in C:\
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
      libraries f77blas,cblas,atlas not found in C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib
      libraries lapack_atlas not found in C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib
      libraries f77blas,cblas,atlas not found in C:\
      libraries lapack_atlas not found in C:\
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    lapack_info:
      libraries lapack not found in ['C:\\PROGRA~1\\QGIS3~1.8\\apps\\Python37\\lib', 'C:\\']
      NOT AVAILABLE

    lapack_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    running egg_info
    running build_src
    build_src
    building py_modules sources
    creating build
    creating build\src.win-amd64-3.7
    creating build\src.win-amd64-3.7\numpy
    creating build\src.win-amd64-3.7\numpy\distutils
    building library "npymath" sources
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    Running from numpy source directory.
    C:\Users\drsno\AppData\Local\Temp\pip-install-w4_kbhro\numpy\numpy\distutils\system_info.py:1522: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      warnings.warn(AtlasNotFoundError.__doc__)
    C:\Users\drsno\AppData\Local\Temp\pip-install-w4_kbhro\numpy\numpy\distutils\system_info.py:1531: UserWarning:
        Blas (http://www.netlib.org/blas/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [blas]) or by setting
        the BLAS environment variable.
      warnings.warn(BlasNotFoundError.__doc__)
    C:\Users\drsno\AppData\Local\Temp\pip-install-w4_kbhro\numpy\numpy\distutils\system_info.py:1534: UserWarning:
        Blas (http://www.netlib.org/blas/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [blas_src]) or by setting
        the BLAS_SRC environment variable.
      warnings.warn(BlasSrcNotFoundError.__doc__)
    C:\Users\drsno\AppData\Local\Temp\pip-install-w4_kbhro\numpy\numpy\distutils\system_info.py:1428: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      warnings.warn(AtlasNotFoundError.__doc__)
    C:\Users\drsno\AppData\Local\Temp\pip-install-w4_kbhro\numpy\numpy\distutils\system_info.py:1439: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      warnings.warn(LapackNotFoundError.__doc__)
    C:\Users\drsno\AppData\Local\Temp\pip-install-w4_kbhro\numpy\numpy\distutils\system_info.py:1442: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      warnings.warn(LapackSrcNotFoundError.__doc__)
    C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

C:\Program Files\QGIS 3.8>
  • 1
    Windows user? If yes, OSGeo4W or standalone installation? – Gabriel De Luca Oct 12 '19 at 11:42
  • hi thanks for responding- yes windows user. Standalone i think (though the OSGeo4W shell is installed) – mike snow Oct 14 '19 at 1:35
  • Honestly, everything is easier with the installation of OSGeo4W. If you can, keep it in mind for the next time you install QGIS on a Windows machine. Now, if you open a console through the file C:\Program Files\QGIS 3.8\OSGeo4W.bat, type the py3_env command, and then the pip3 install netcdf command, what is the result? Please do not answer only in the comments, also edit your question to expand the information. – Gabriel De Luca Oct 14 '19 at 5:01
  • I get the following error log when i attempt this pastebin.com/tjJ12suy thanks – mike snow Oct 14 '19 at 6:18
0

I performed a stand-alone installation of QGIS and got the same error.
I was doing a little research and I think the library to install is called netcdf4. In addition, I had to open the OSGeo4W console with administrator privileges.

The steps were as follows, if you want to test that they are a solution to your question:

  • Run with Administrator privileges the OSGeo4W console through the file C:\Program Files\QGIS 3.8\OSGeo4W.bat:
run o-help for a list of available commands
C:\Windows\System32>
  • Navigate to the root:
C:\Windows\System32>cd..

C:\Windows>cd..

C:\>
  • Temporarily set Python3 environment variables for this console through the py3_env command:
C:\>py3_env

C:\>SET PYTHONPATH=

C:\>SET PYTHONHOME=C:\PROGRA~1\QGIS3~1.8\apps\Python37

C:\>PATH C:\PROGRA~1\QGIS3~1.8\apps\Python37;C:\PROGRA~1\QGIS3~1.8\apps\Python37\Scripts;{app};C:\PROGRA~1\QGIS3~1.8\apps\Python27\Scripts;C:\PROGRA~1\QGIS3~1.8\bin;C:\WINDOWS\system32;C:\WINDOWS
  • Install the netcdf4 library trough the pip3 install netcdf4 command:
C:\>pip3 install netcdf4
Collecting netcdf4
  Downloading https://files.pythonhosted.org/packages/e5/42/48bbea10b85bb5df618d53f2110fca98e6f8d66f3763540ae58eada9a1a2/netCDF4-1.5.2-cp37-cp37m-win_amd64.whl (3.1MB)
     |████████████████████████████████| 3.1MB 1.3MB/s
Collecting cftime (from netcdf4)
  Downloading https://files.pythonhosted.org/packages/e0/d7/1c3d2edc4cc6c3f16515811d3671dad4d355c6945b49eecbf448688c61c5/cftime-1.0.3.4-cp37-none-win_amd64.whl (206kB)
     |████████████████████████████████| 215kB 939kB/s
Requirement already satisfied: numpy>=1.7 in c:\progra~1\qgis3~1.8\apps\python37\lib\site-packages (from netcdf4) (1.16.3)
Installing collected packages: cftime, netcdf4
Successfully installed cftime-1.0.3.4 netcdf4-1.5.2

C:\>
  • I tried this thank you- it looks like i had already installed it? now please how do i get this to launch within the QGIS python console . Thank you pastebin.com/W1XJFk6g – mike snow Oct 15 '19 at 6:39
  • I believe that by having the library installed, you will receive the full support for NetCDF files that the plugin was requesting. Reproduce the steps described in your question, does the message still appear? – Gabriel De Luca Oct 15 '19 at 9:10
  • Yes i still get the "for full netCDF support please pip install netCDF. Time manager does not recognise the time format which is eg Band 015: time=80158 (days since 1800-01-01 00:00:00.0) – mike snow Oct 16 '19 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.