django / Coolprop to Refprop fails on Linux

75 views
Skip to first unread message

Reiner Johannes Mayers

unread,
Nov 6, 2015, 8:43:10 AM11/6/15
to coolprop-users
Hi guys,

I try to run the Coolprop/Refprop link inside of a django (1.8.x) web
application
on linux. Just using CoolProp without Refprop works fine. In the exact
same Python
environment the Refprop link works without problem. Unless I invoke the
command
from the django manager ... python manage.py refprop_km

Any experiance with this?

regards
Reiner

$DjangoAppDir/management/commands/refprop_km.py :

#### code
from django.core.management.base import BaseCommand, CommandError

import CoolProp.CoolProp as CP

class Command(BaseCommand):
help = 'imports data for mixtures from refprop to the tables'

def handle(self, *args, **options):
#
ref='REFPROP::R134a'
evap=CP.PropsSI('T','P',101325,'Q',0,ref)-273.15
####/code

Output :


Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File
"/home/mayers/PyEnv/kformaug/lib/python3.4/site-packages/django/core/management/__init__.py",
line 338, in execute_from_command_line
utility.execute()
File
"/home/mayers/PyEnv/kformaug/lib/python3.4/site-packages/django/core/management/__init__.py",
line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/home/mayers/PyEnv/kformaug/lib/python3.4/site-packages/django/core/management/base.py",
line 393, in run_from_argv
self.execute(*args, **cmd_options)
File
"/home/mayers/PyEnv/kformaug/lib/python3.4/site-packages/django/core/management/base.py",
line 444, in execute
output = self.handle(*args, **options)
File
"/home/mayers/git/kformaug/kform/stammdat/management/commands/refprop_km.py",
line 20, in handle
evap=CP.PropsSI('T','P',101325,'Q',0,ref)-273.15
File "CoolProp/CoolProp.pyx", line 278, in CoolProp.CoolProp.PropsSI
(CoolProp/CoolProp.cpp:30608)
File "CoolProp/CoolProp.pyx", line 358, in CoolProp.CoolProp.PropsSI
(CoolProp/CoolProp.cpp:30393)
File "CoolProp/CoolProp.pyx", line 247, in
CoolProp.CoolProp.__Props_err2 (CoolProp/CoolProp.cpp:28598)
ValueError: Initialize failed for backend: "REFPROP", fluid: "R134a"
fractions "[ 1,0000000000 ]"; error: Could not load these fluids: R134a
: PropsSI("T","P",101325,"Q",0,"REFPROP::R134a")

Comment:
There is no File CoolProp.pyx


Ian Bell

unread,
Nov 6, 2015, 9:21:23 AM11/6/15
to Reiner Johannes Mayers, coolprop-users
CoolProp.pyx is the "source" code for cython modules. 

This seems to me to be highly likely to be a permissions problem.  Probably your REFPROP directory is not accessible by the user that django runs as, while you can run as you no problem since you have sufficient permissions to read the shared library.  Maybe relocate REFPROP to within your django tree, and make sure the permissions are sufficiently relaxed?



--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.
To post to this group, send email to coolpro...@googlegroups.com.
Visit this group at http://groups.google.com/group/coolprop-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages