Unable to Import CoolProp

127 Views Asked by At

I am new in programming thing, I just start it yesterday maybe its very basic

I want to import coolProp to input Cp and Cv value, but when i type:

import CoolProp.CoolProp as CP

it shows following messages:

```python
TypeError                                 Traceback (most recent call last)
d:\PythonMatpotlib\Cycles_JupyterNotebook.ipynb Cell 9 line 1
----> 1 import CoolProp
      2 import CoolProp.CoolProp as CP

File d:\PythonMatpotlib\first_venv\Lib\site-packages\CoolProp\__init__.py:22
     19 from . import State
     20 from .constants import *
---> 22 __fluids__ = CoolProp.get_global_param_string('fluids_list').split(',')
     23 __incompressibles_pure__ = CoolProp.get_global_param_string('incompressible_list_pure').split(',')
     24 __incompressibles_solution__ = CoolProp.get_global_param_string('incompressible_list_solution').split(',')

File CoolProp.pyx:309, in CoolProp.CoolProp.get_global_param_string()

File stringsource:15, in string.from_py.__pyx_convert_string_from_py_std__in_string()

TypeError: expected bytes, str found
```

can you guys help me with this?

I already tried to install and uninstall coolProp, upgrade python version, looking for answer through chat GPT, youtube and website but it didnt work

1

There are 1 best solutions below

2
maxc900 On

The issue relates to Python 3.12. You can resolve it by downgrading to Python 3.11. Another option is manually building of CoolProp. That worked for me.