[Tutor] Error When Using CoolProp

Bernard Marjaba marjababernard at gmail.com
Mon Nov 29 19:01:04 EST 2021


Hello,

Yeah sure I’m checking with them as well. Meanwhile, this is a purely python related error following what you suggested to me about installing the wheel package:

I tried installing the wheel package using 

(venv) Bernards-MacBook-Pro:Python Bernard$ pip install /Users/Bernard/Downloads/CoolProp-6.4.1-cp38-cp38-macosx_10_9_x86_64.whl

but it gave me this error

ERROR: CoolProp-6.4.1-cp38-cp38-macosx_10_9_x86_64.whl is not a supported wheel on this platform.

I assume this means that i need python 3.8 for this wheel to work, which I have. I typed python3 in terminal it gave me 3.8.10, i typed python3 in PyCharm and it gave me 3.9.5, how come? So i searched for python 3.9 in my MacBook and i couldn’t find any traces of it, except for in a project folder: /Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/lib/python3.9

However, 3.8 exists in the Applications folder. Any idea how to remove all traces of 3.9?

Thanks and regards,
Bernard Marjaba
(514) 922-9807

> On Nov 24, 2021, at 6:53 PM, Mats Wichmann <mats at wichmann.us> wrote:
> 
> On 11/24/21 13:17, Bernard Marjaba wrote:
>> Hello
>> I am having trouble using CoolProp with python. I have macOS Big Sur 11.5.1 with python version 3.10.
>> import CoolProp.CoolProp as CP
>> is giving me the error ModuleNotFoundError: No module named ‘CoolProp.CoolProp’ because it is not installed. I am however using it with MATLAB with no issues. I assume each software has its own wrapper?
>> So I tried installing CoolProp using pip install coolprop, and got the following error:
>> Collecting coolprop
>>   Using cached CoolProp-6.4.1.tar.gz (12.9 MB)
>>   Preparing metadata (setup.py) ... done
>> Using legacy 'setup.py install' for coolprop, since package 'wheel' is not installed.
>> Installing collected packages: coolprop
>>     Running setup.py install for coolprop ... error
>>     ERROR: Command errored out with exit status 1:
>>      command: '/Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/bin/python' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/setup.py'"'"'; __file__='"'"'/private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-record-8453i4i7/install-record.txt --single-version-externally-managed --compile --install-headers '/Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/include/site/python3.9/coolprop'
>>          cwd: /private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/
>>     Complete output (79 lines):
>>     xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
>>     OSX build detected, targetting 10.9 using clang/gcc v0.0.
>>     Cython will not be used; cy_ext is cpp
>>     running install
>>     /Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
>>       warnings.warn(
>>     running build
>>     running build_py
>>     creating build
>>     creating build/lib.macosx-10.9-x86_64-3.9
>>     creating build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/constants.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/BibtexParser.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/HumidAirProp.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/State.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     creating build/lib.macosx-10.9-x86_64-3.9/CoolProp/tests
>>     copying CoolProp/tests/runner.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/tests
>>     copying CoolProp/tests/test_plots.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/tests
>>     copying CoolProp/tests/test_Props.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/tests
>>     copying CoolProp/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/tests
>>     copying CoolProp/tests/test_CoolPropState.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/tests
>>     creating build/lib.macosx-10.9-x86_64-3.9/CoolProp/GUI
>>     copying CoolProp/GUI/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/GUI
>>     copying CoolProp/GUI/CoolPropGUI.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/GUI
>>     copying CoolProp/GUI/PsychScript.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/GUI
>>     creating build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/ConsistencyPlots_pcsaft.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/PsychChart.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/SimpleCycles.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/psy.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/Plots.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/Common.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/SimpleCyclesCompression.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/ConsistencyPlots.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/PsychScript.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/Tests.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/Plots/SimpleCyclesExpansion.py -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     copying CoolProp/typedefs.pxd -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/CoolProp.pxd -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/State.pxd -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/cAbstractState.pxd -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/constants_header.pxd -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/AbstractState.pxd -> build/lib.macosx-10.9-x86_64-3.9/CoolProp
>>     copying CoolProp/Plots/psyrc -> build/lib.macosx-10.9-x86_64-3.9/CoolProp/Plots
>>     running build_ext
>>     creating private
>>     creating private/var
>>     creating private/var/folders
>>     creating private/var/folders/1j
>>     creating private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn
>>     creating private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T
>>     creating private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx
>>     creating private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4
>>     gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/tmp0hdk2tsu.cpp -o private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/tmp0hdk2tsu.o
>>     xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
>>     gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/tmp0r3vfej0.cpp -o private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/tmp0r3vfej0.o
>>     xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
>>     gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/tmp93394q_4.cpp -o private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/tmp93394q_4.o
>>     xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
>>     Adding these shared_ptr compilation macros: []
>>     building 'CoolProp.CoolProp' extension
>>     creating build/temp.macosx-10.9-x86_64-3.9
>>     creating build/temp.macosx-10.9-x86_64-3.9/CoolProp
>>     creating build/temp.macosx-10.9-x86_64-3.9/src
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Backends
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Backends/Cubics
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Backends/Helmholtz
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Backends/Helmholtz/Fluids
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Backends/IF97
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Backends/Incompressible
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Backends/PCSAFT
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Backends/REFPROP
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Backends/Tabular
>>     creating build/temp.macosx-10.9-x86_64-3.9/src/Tests
>>     gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I. -I./include -I./src -I./externals/Eigen -I./externals/fmtlib -I./externals/msgpack-c/include -I/Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c CoolProp/CoolProp.cpp -o build/temp.macosx-10.9-x86_64-3.9/CoolProp/CoolProp.o
>>     xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
>>     error: command '/usr/bin/gcc' failed with exit code 1
>>     ----------------------------------------
>> ERROR: Command errored out with exit status 1: '/Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/bin/python' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/setup.py'"'"'; __file__='"'"'/private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-install-z5afcrzx/coolprop_6739af7137474652994855ae32a03dd4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1j/jv39r0t12cb4dhscxkdz97740000gn/T/pip-record-8453i4i7/install-record.txt --single-version-externally-managed --compile --install-headers '/Users/Bernard/PycharmProjects/Isentropic SUS Model/venv/include/site/python3.9/coolprop' Check the logs for full command output.
> 
> 
> looks like you probably don't have the command-line developer tools installed - it's separate from the main xcode install on MacOS.
> 
> also, you might be able to install without the effort to build if you installed the wheel package first - see this error from early on:
> 
> > Using legacy 'setup.py install' for coolprop, since package 'wheel' is not installed.
> 
> I have no idea what CoolProp is, never heard of it, but a check here:
> 
> https://pypi.org/project/CoolProp/#files <https://pypi.org/project/CoolProp/#files>
> 
> shows there *is* a macosx wheel available for installation - at least as long as you're using no newer than Python 3.8.  The project looks like it hasn't updated for a good long time so they haven't done anything for 3.9 or 3.10. That's probably cause for some worry...
> 
> You'd be far better asking this kind of thing directly to the project in question, we won't be able to answer any further stuff from here.



More information about the Tutor mailing list