pyswmm / pyswmm

Python Wrappers for SWMM
https://www.pyswmm.org
Other
286 stars 135 forks source link

Pyswmm Installation failed to Build "swmm-toolkit" #271

Closed Rellis883 closed 3 years ago

Rellis883 commented 3 years ago

Trying to Install Pyswmm-1.0.1 Note: Have already tried installing Visual Studio (current and 2017 version), but pip did not register it

C:\Users\andre>pip install pyswmm Collecting pyswmm Using cached pyswmm-1.0.1-py3-none-any.whl (88 kB) Collecting swmm-toolkit>=0.8.1 Using cached swmm-toolkit-0.8.1.zip (644 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Collecting aenum Using cached aenum-3.0.0-py3-none-any.whl (47 kB) Building wheels for collected packages: swmm-toolkit Building wheel for swmm-toolkit (PEP 517) ... error ERROR: Command errored out with exit status 1: command: 'd:\python program\python.exe' 'd:\python program\lib\site-packages\pip_vendor\pep517_in_process.py' build_wheel 'C:\Users\andre\AppData\Local\Temp\tmp72cl8f17' cwd: C:\Users\andre\AppData\Local\Temp\pip-install-2thphwqs\swmm-toolkit_6edd346da94d44afb04da67c64faeae9 Complete output (44 lines): d:\python program\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'cmake_process_manifest_hook' warnings.warn(msg) Not searching for unused variables given on the command line. CMake Error at CMakeLists.txt:2 (PROJECT): Generator

  Visual Studio 15 2017 Win64

could not find any instance of Visual Studio.

-- Configuring incomplete, errors occurred! See also "C:/Users/andre/AppData/Local/Temp/pip-install-2thphwqs/swmm-toolkit_6edd346da94d44afb04da67c64faeae9/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".


-- Trying "Visual Studio 15 2017 Win64" generator






--







-- Trying "Visual Studio 15 2017 Win64" generator - failure


scikit-build could not get a working generator for your system. Aborting build.

Building windows wheels for Python 3.9 requires Microsoft Visual Studio 2017. Get it with "Visual Studio 2017":

https://visualstudio.microsoft.com/vs/


ERROR: Failed building wheel for swmm-toolkit Failed to build swmm-toolkit ERROR: Could not build wheels for swmm-toolkit which use PEP 517 and cannot be installed directly

Laptop

Additional context Operating System is located on C Drive while Python and other programs located on another D drive. Had a storage issue.

jennwuu commented 3 years ago

@Rellis883 Can you try reinstalling with python 64 bit? 32-bit is not supported in pyswmm v1.0.0+

michaeltryby commented 3 years ago

Need to pin down aenum dependency to v2.2.6. SWMM-toolkit does not work with v3.0.0.

Rellis883 commented 3 years ago

@jennwuu I reinstalled with 64 bit and still got the same error

Rellis883 commented 3 years ago

@michaeltryby I installed aenum-2.2.6 and still got same error

Collecting pyswmm Using cached pyswmm-1.0.1-py3-none-any.whl (88 kB) Collecting swmm-toolkit>=0.8.1 Using cached swmm-toolkit-0.8.1.zip (644 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Requirement already satisfied: aenum in d:\python program\lib\site-packages (from swmm-toolkit>=0.8.1->pyswmm) (2.2.6) Building wheels for collected packages: swmm-toolkit Building wheel for swmm-toolkit (PEP 517) ... error

jennwuu commented 3 years ago

Hmmm, it shouldn't be trying to build swmm-toolkit. It should be downloading from a whl file instead. @michaeltryby

It looks it is using cached swmm-toolkit. Is it possible to clear and reinstall?

You should be seeing something like this:

Collecting pyswmm
  Downloading https://files.pythonhosted.org/packages/e0/08/14c95572f88e4785809a76d183cf2a0565280272dc2307423382d7e73d95/pyswmm-1.0.1-py3-none-any.whl (88kB)
     |████████████████████████████████| 92kB 5.8MB/s
Collecting swmm-toolkit>=0.8.1 (from pyswmm)
  Downloading https://files.pythonhosted.org/packages/69/21/269e6ce55a9350a1650efcd480c5ebc4b5551e2375a65ade00336040a742/swmm_toolkit-0.8.1-cp37-cp37m-win_amd64.whl (906kB)
     |████████████████████████████████| 911kB 6.8MB/s
Collecting aenum (from swmm-toolkit>=0.8.1->pyswmm)
  Downloading https://files.pythonhosted.org/packages/42/6c/9f1fde94c439d8b9ef99935ea3f7d86f36824c1ff038777a6c126162a933/aenum-3.0.0-py3-none-any.whl (47kB)
     |████████████████████████████████| 51kB 3.2MB/s
Installing collected packages: aenum, swmm-toolkit, pyswmm
Successfully installed aenum-3.0.0 pyswmm-1.0.1 swmm-toolkit-0.8.1
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Rellis883 commented 3 years ago

@jennwuu

C:\Users\andre>pip install pyswmm --no-cache-dir Collecting pyswmm Downloading pyswmm-1.0.1-py3-none-any.whl (88 kB) |████████████████████████████████| 88 kB 2.0 MB/s Collecting swmm-toolkit>=0.8.1 Downloading swmm-toolkit-0.8.1.zip (644 kB) |████████████████████████████████| 644 kB 6.8 MB/s Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Requirement already satisfied: aenum in d:\python program\lib\site-packages (from swmm-toolkit>=0.8.1->pyswmm) (2.2.6) Building wheels for collected packages: swmm-toolkit Building wheel for swmm-toolkit (PEP 517) ... error

jennwuu commented 3 years ago

@Rellis883 Can you double check to see if your pip is using python 64-bit?

jennwuu commented 3 years ago

@Rellis883 you can also try to installing swmm-toolkit using the .whl files from https://pypi.org/project/swmm-toolkit/0.8.1/#files

kevincasipillai commented 3 years ago

I got the exact same error. im using windows 10, python 3.9 x64 and the latest version of pip trying to install pyswmm.

kevincasipillai commented 3 years ago

this is the message i get:

C:\Users\KevinCasipillai>pip install pyswmm Collecting pyswmm Using cached pyswmm-1.0.1-py3-none-any.whl (88 kB) Collecting swmm-toolkit>=0.8.1 Using cached swmm-toolkit-0.8.1.zip (644 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Requirement already satisfied: aenum in c:\users\kevincasipillai\appdata\local\programs\python\python39\lib\site-packages (from swmm-toolkit>=0.8.1->pyswmm) (3.0.0) Building wheels for collected packages: swmm-toolkit Building wheel for swmm-toolkit (PEP 517) ... error ERROR: Command errored out with exit status 1: command: 'c:\users\kevincasipillai\appdata\local\programs\python\python39\python.exe' 'c:\users\kevincasipillai\appdata\local\programs\python\python39\lib\site-packages\pip_vendor\pep517_in_process.py' build_wheel 'C:\Users\KEVINC~1\AppData\Local\Temp\tmpoanpqabj' cwd: C:\Users\KevinCasipillai\AppData\Local\Temp\pip-install-bya_tq0m\swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb Complete output (108 lines): c:\users\kevincasipillai\appdata\local\programs\python\python39\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'cmake_process_manifest_hook' warnings.warn(msg) Not searching for unused variables given on the command line. -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19041. -- The C compiler identification is MSVC 19.16.27045.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- The CXX compiler identification is MSVC 19.16.27045.0 CMake Warning (dev) at C:/Users/KevinCasipillai/AppData/Local/Temp/pip-build-env-rfs_jxno/overlay/Lib/site-packages/cmake/data/share/cmake-3.18/Modules/CMakeDetermineCXXCompiler.cmake:157 (if): Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when unquoted. Run "cmake --help-policy CMP0054" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Quoted variables like "MSVC" will no longer be dereferenced when the policy
is set to NEW.  Since the policy is not set the OLD behavior will be used.

Call Stack (most recent call first): CMakeLists.txt:4 (ENABLE_LANGUAGE) This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at C:/Users/KevinCasipillai/AppData/Local/Temp/pip-build-env-rfs_jxno/overlay/Lib/site-packages/cmake/data/share/cmake-3.18/Modules/CMakeDetermineCXXCompiler.cmake:177 (elseif): Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when unquoted. Run "cmake --help-policy CMP0054" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Quoted variables like "MSVC" will no longer be dereferenced when the policy
is set to NEW.  Since the policy is not set the OLD behavior will be used.

Call Stack (most recent call first): CMakeLists.txt:4 (ENABLE_LANGUAGE) This warning is for project developers. Use -Wno-dev to suppress it.

-- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: C:/Users/KevinCasipillai/AppData/Local/Temp/pip-install-bya_tq0m/swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb/_cmake_test_compile/build -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19041. -- The C compiler identification is MSVC 19.16.27045.0 -- The CXX compiler identification is MSVC 19.16.27045.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - 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: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Python: c:/users/kevincasipillai/appdata/local/programs/python/python39/python.exe (found suitable version "3.9.0", minimum required is "3.9.0") found components: Interpreter Development Development.Module Development.Embed CMake Error at C:/Users/KevinCasipillai/AppData/Local/Temp/pip-build-env-rfs_jxno/overlay/Lib/site-packages/cmake/data/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message): Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR) Call Stack (most recent call first): C:/Users/KevinCasipillai/AppData/Local/Temp/pip-build-env-rfs_jxno/overlay/Lib/site-packages/cmake/data/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE) C:/Users/KevinCasipillai/AppData/Local/Temp/pip-build-env-rfs_jxno/overlay/Lib/site-packages/cmake/data/share/cmake-3.18/Modules/FindSWIG.cmake:105 (find_package_handle_standard_args) CMakeLists.txt:25 (find_package)

-- Configuring incomplete, errors occurred! See also "C:/Users/KevinCasipillai/AppData/Local/Temp/pip-install-bya_tq0m/swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb/_skbuild/win-amd64-3.9/cmake-build/CMakeFiles/CMakeOutput.log". File "C:\Users\KevinCasipillai\AppData\Local\Temp\pip-build-env-rfs_jxno\overlay\Lib\site-packages\skbuild\setuptools_wrap.py", line 582, in setup env = cmkr.configure(cmake_args, File "C:\Users\KevinCasipillai\AppData\Local\Temp\pip-build-env-rfs_jxno\overlay\Lib\site-packages\skbuild\cmaker.py", line 229, in configure raise SKBuildError(


-- Trying "Visual Studio 15 2017 Win64 v141" generator






--







-- Trying "Visual Studio 15 2017 Win64 v141" generator - success

Configuring Project Working directory: C:\Users\KevinCasipillai\AppData\Local\Temp\pip-install-bya_tq0m\swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb_skbuild\win-amd64-3.9\cmake-build Command: cmake 'C:\Users\KevinCasipillai\AppData\Local\Temp\pip-install-bya_tq0m\swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb' -G 'Visual Studio 15 2017 Win64' '-DCMAKE_INSTALL_PREFIX:PATH=C:\Users\KevinCasipillai\AppData\Local\Temp\pip-install-bya_tq0m\swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb_skbuild\win-amd64-3.9\cmake-install' '-DPYTHON_EXECUTABLE:FILEPATH=c:\users\kevincasipillai\appdata\local\programs\python\python39\python.exe' -DPYTHON_VERSION_STRING:STRING=3.9.0 '-DPYTHON_INCLUDE_DIR:PATH=c:\users\kevincasipillai\appdata\local\programs\python\python39\Include' '-DPYTHON_LIBRARY:FILEPATH=c:\users\kevincasipillai\appdata\local\programs\python\python39\libs\python39.lib' -DSKBUILD:BOOL=TRUE '-DCMAKE_MODULE_PATH:PATH=C:\Users\KevinCasipillai\AppData\Local\Temp\pip-build-env-rfs_jxno\overlay\Lib\site-packages\skbuild\resources\cmake' -DCMAKE_BUILD_TYPE:STRING=Release

Traceback (most recent call last):

An error occurred while configuring with CMake. Command: cmake 'C:\Users\KevinCasipillai\AppData\Local\Temp\pip-install-bya_tq0m\swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb' -G 'Visual Studio 15 2017 Win64' '-DCMAKE_INSTALL_PREFIX:PATH=C:\Users\KevinCasipillai\AppData\Local\Temp\pip-install-bya_tq0m\swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb_skbuild\win-amd64-3.9\cmake-install' '-DPYTHON_EXECUTABLE:FILEPATH=c:\users\kevincasipillai\appdata\local\programs\python\python39\python.exe' -DPYTHON_VERSION_STRING:STRING=3.9.0 '-DPYTHON_INCLUDE_DIR:PATH=c:\users\kevincasipillai\appdata\local\programs\python\python39\Include' '-DPYTHON_LIBRARY:FILEPATH=c:\users\kevincasipillai\appdata\local\programs\python\python39\libs\python39.lib' -DSKBUILD:BOOL=TRUE '-DCMAKE_MODULE_PATH:PATH=C:\Users\KevinCasipillai\AppData\Local\Temp\pip-build-env-rfs_jxno\overlay\Lib\site-packages\skbuild\resources\cmake' -DCMAKE_BUILD_TYPE:STRING=Release Source directory: C:\Users\KevinCasipillai\AppData\Local\Temp\pip-install-bya_tq0m\swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb Working directory: C:\Users\KevinCasipillai\AppData\Local\Temp\pip-install-bya_tq0m\swmm-toolkit_6f2efc063cf44ec184c3809a0aa4c5fb_skbuild\win-amd64-3.9\cmake-build Please see CMake's output for more information.

ERROR: Failed building wheel for swmm-toolkit Failed to build swmm-toolkit ERROR: Could not build wheels for swmm-toolkit which use PEP 517 and cannot be installed directly

jennwuu commented 3 years ago

@kevincasipillai thanks. I'm not sure why swmm-toolkit installation is being built instead of installation from .whl files. @michaeltryby thoughts what could be the issue?

jennwuu commented 3 years ago

@kevincasipillai Oh I see. @michaeltryby We don't have a .whl file for python 3.9 which is causing swmm-toolkit installation to go through build instead of installation from .whl https://pypi.org/project/swmm-toolkit/0.8.1/#files

@michaeltryby Can we add .whl for swmm-toolkit for python 3.9?

@kevincasipillai swmm-toolkit should install for Python versions 3.6 to 3.8 64-bit. Can you try with another python installation? Thank you for your patience!

jennwuu commented 3 years ago

@Rellis883 swmm-toolkit should install for Python versions 3.6 to 3.8 64-bit. Can you try with another python installation? Thank you for your patience!

kevincasipillai commented 3 years ago

@jennwuu im sorry Im not too Good at Python and have had issues Running my scripts after changing from Python 3.6 to 3.9 so maybe i Think i Will wait until it works with Python 3.9 - Thank you Very Much for the Quick responsen :-)

Rellis883 commented 3 years ago

@jennwuu @michaeltryby I got PySWMM to successfully install after changing Python to version 3.8 64 Bit and having aenum 2.2.6. Thank you so much for your help and quick responses!