OpenWaterAnalytics / epanet-python

python wrapper for epanet library
76 stars 40 forks source link

Errors on instalation #69

Closed pdMa2s closed 3 years ago

pdMa2s commented 3 years ago

I've tried doing this

$ python -m pip install owa-epanet --user

and returned this error:

 ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-od5rmipk/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pdma2s/.local/include/python3.8/owa-epanet                                                               
         cwd: /tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/                                                                                                                                                 
    Complete output (90 lines):                                                                                                                                                                                                      

    --------------------------------------------------------------------------------                                                                                                                                                 
    -- Trying "Ninja" generator                                                                                                                                                                                                      
    --------------------------------                                                                                                                                                                                                 
    ---------------------------                                                                                                                                                                                                      
    ----------------------                                                                                                                                                                                                           
    -----------------                                                                                                                                                                                                                
    ------------                                                                                                                                                                                                                     
    -------                                                                                                                                                                                                                          
    --                                                                                                                                                                                                                               
    Not searching for unused variables given on the command line.                                                                                                                                                                    
    CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):                                                                                                                                                          
      Compatibility with CMake < 2.8.12 will be removed from a future version of                                                                                                                                                     
      CMake.                                                                                                                                                                                                                         

      Update the VERSION argument <min> value or use a ...<max> suffix to tell                                                                                                                                                       
      CMake that the project does not need compatibility with older versions.                                                                                                                                                        

    -- The C compiler identification is GNU 10.2.0                                                                                                                                                                                   
    -- Detecting C compiler ABI info                                                                                                                                                                                                 
    -- Detecting C compiler ABI info - done                                                                                                                                                                                          
    -- Check for working C compiler: /usr/bin/cc - skipped                                                                                                                                                                           
    -- Detecting C compile features                                                                                                                                                                                                  
    -- Detecting C compile features - done                                                                                                                                                                                           
    -- The CXX compiler identification is GNU 10.2.0                                                                                                                                                                                 
    -- Detecting CXX compiler ABI info                                                                                                                                                                                               
    -- Detecting CXX compiler ABI info - done                                                                                                                                                                                        
    -- Check for working CXX compiler: /usr/bin/c++ - skipped                                                                                                                                                                        
    -- Detecting CXX compile features                                                                                                                                                                                                
    -- Detecting CXX compile features - done                                                                                                                                                                                         
    -- Configuring done                                                                                                                                                                                                              
    -- Generating done                                                                                                                                                                                                               
    -- Build files have been written to: /tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/_cmake_test_compile/build                                                                                             
    --                                                                                                                                                                                                                               
    -------                                                                                                                                                                                                                          
    ------------                                                                                                                                                                                                                     
    -----------------                                                                                                                                                                                                                
    ----------------------                                                                                                                                                                                                           
    ---------------------------                                                                                                                                                                                                      
    --------------------------------                                                                                                                                                                                                 
    -- Trying "Ninja" generator - success                                                                                                                                                                                            
    --------------------------------------------------------------------------------                                                                                                                                                 

    Configuring Project                                                                                                                                                                                                              
      Working directory:                                                                                                                                                                                                             
        /tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/_skbuild/linux-x86_64-3.8/cmake-build                                                                                                                  
      Command:                                                                                                                                                                                                                       
        cmake /tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71 -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/_skbuild/linux-x86_64-3.8/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python -DPYTHON_VERSION_STRING:STRING=3.8.6 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 -DPYTHON_LIBRARY:FILEPATH=/usr/lib/libpython3.8.so -DSKBUILD:BOOL=TRUE -DCMAKE_MODULE_PATH:PATH=/home/pdma2s/.local/lib/python3.8/site-packages/skbuild/resources/cmake -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DCMAKE_BUILD_TYPE:STRING=Release                                                                                  

    -- The C compiler identification is GNU 10.2.0                                                                                                                                                                                   
    -- The CXX compiler identification is GNU 10.2.0                                                                                                                                                                                 
    -- Detecting C compiler ABI info                                                                                                                                                                                                 
    -- Detecting C compiler ABI info - done                                                                                                                                                                                          
    -- Check for working C compiler: /usr/bin/cc - skipped                                                                                                                                                                           
    -- Detecting C compile features                                                                                                                                                                                                  
    -- Detecting C compile features - done                                                                                                                                                                                           
    -- Detecting CXX compiler ABI info                                                                                                                                                                                               
    -- Detecting CXX compiler ABI info - done                                                                                                                                                                                        
    -- Check for working CXX compiler: /usr/bin/c++ - skipped                                                                                                                                                                        
    -- Detecting CXX compile features                                                                                                                                                                                                
    -- Detecting CXX compile features - done                                                                                                                                                                                         
    -- The project is built using scikit-build                                                                                                                                                                                       
    -- Found PythonLibs: /usr/lib/libpython3.8.so (found suitable version "3.8.6", minimum required is "3")                                                                                                                          
    -- Found PythonInterp: /usr/bin/python (found suitable version "3.8.6", minimum required is "3.8.6")
    CMake Error at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
      Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
    Call Stack (most recent call first):
      /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:577 (_FPHSA_FAILURE_MESSAGE)
      /usr/share/cmake-3.19/Modules/FindSWIG.cmake:138 (find_package_handle_standard_args)
      CMakeLists.txt:19 (find_package)

    -- Configuring incomplete, errors occurred!
    See also "/tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/_skbuild/linux-x86_64-3.8/cmake-build/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "/home/pdma2s/.local/lib/python3.8/site-packages/skbuild/setuptools_wrap.py", line 582, in setup
        env = cmkr.configure(cmake_args,
      File "/home/pdma2s/.local/lib/python3.8/site-packages/skbuild/cmaker.py", line 229, in configure
        raise SKBuildError(

    An error occurred while configuring with CMake.
      Command:
        cmake /tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71 -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/_skbuild/linux-x86_64-3.8/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python -DPYTHON_VERSION_STRING:STRING=3.8.6 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 -DPYTHON_LIBRARY:FILEPATH=/usr/lib/libpython3.8.so -DSKBUILD:BOOL=TRUE -DCMAKE_MODULE_PATH:PATH=/home/pdma2s/.local/lib/python3.8/site-packages/skbuild/resources/cmake -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DCMAKE_BUILD_TYPE:STRING=Release
      Source directory:
        /tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71
      Working directory:
        /tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/_skbuild/linux-x86_64-3.8/cmake-build
    Please see CMake's output for more information.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5tonw7z1/owa-epanet_3b448e6abee14f07a6dcbd1b2fbbbe71/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-od5rmipk/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pdma2s/.local/include/python3.8/owa-epanet Check the logs for full command output.

Is there something I can do to fix this issue?

Lorenzo-Zingali commented 3 years ago

Hello, I had maybe the same problem. You could try to fix it by downloading SWIG (http://www.swig.org/download.html) and by adding to the PATH of Windows 10 "C:../swigwin-3.0.12/swig.exe" and "C:.../swigwin-3.0.12/". In this way I was able to install owa-epanet. Now I am trying to use the toolkit but I have some difficulties. I'm just beginning to use python, but if you want we can stay in touch to try to resolve any problems.

pdMa2s commented 3 years ago

I can try that, thanks. Meanwhile I had to resort to wntr

samhatchett commented 3 years ago

closing: as this was a build-time error having to due with a missing dep