Skip to content

LuxPy import issue in Conda (Python 3.12.13) #44

@frank984

Description

@frank984

I am working in a Conda environment with the following installed packages:
luxpy 1.11.2
numpy 1.26.4
scipy 1.17.1
python 3.12.13

When trying to verify LuxPy installation:
python -c "import luxpy as lx; print('LuxPy OK', lx.version)"
the import fails with the following error:
TypeError: only 0-dimensional arrays can be converted to Python scalars.

Detailof installed packages below:
anyio 4.12.1
argon2-cffi 25.1.0
argon2-cffi-bindings 25.1.0
asttokens 3.0.1
async-lru 2.0.5
attrs 26.1.0
babel 2.17.0
beautifulsoup4 4.14.3
bleach 4.1.0
brotlicffi 1.2.0.0
cdsapi 0.7.6
certifi 2026.1.4
cffi 2.0.0
cftime 1.6.5
charset-normalizer 3.4.4
colorama 0.4.6
comm 0.2.3
contourpy 1.3.3
cycler 0.12.1
debugpy 1.8.16
decorator 5.2.1
defusedxml 0.7.1
ecmwf-datastores-client 0.5.1
epw 0.0.0
era5epw 0.6.0
et_xmlfile 2.0.0
executing 2.2.1
fastjsonschema 2.21.2
fonttools 4.62.1
h11 0.16.0
h5py 3.16.0
httpcore 1.0.9
httpx 0.28.1
idna 3.11
ipykernel 7.2.0
ipython 9.11.0
ipython_pygments_lexers 1.1.1
jedi 0.19.2
Jinja2 3.1.6
json5 0.12.1
jsonschema 4.25.1
jsonschema-specifications 2025.9.1
jupyter_client 8.8.0
jupyter_core 5.9.1
jupyter-events 0.12.0
jupyter-lsp 2.3.0
jupyter_server 2.17.0
jupyter_server_terminals 0.5.4
jupyterlab 4.5.6
jupyterlab_pygments 0.3.0
jupyterlab_server 2.28.0
kiwisolver 1.5.0
luxpy 1.11.2
MarkupSafe 3.0.2
matplotlib 3.10.8
matplotlib-inline 0.2.1
mistune 3.1.2
mkl_fft 2.1.1
mkl_random 1.3.0
mkl-service 2.5.2
multiurl 0.3.7
nbclient 0.10.4
nbconvert 7.17.0
nbformat 5.10.4
nest-asyncio 1.6.0
netCDF4 1.7.2
notebook 7.5.5
notebook_shim 0.2.4
numpy 1.26.4
openpyxl 3.1.5
packaging 26.0
pandas 2.2.3
pandocfilters 1.5.1
parso 0.8.5
pillow 12.2.0
pip 26.0.1
platformdirs 4.9.4
plotly 5.24.1
prometheus_client 0.24.1
prompt_toolkit 3.0.52
psutil 7.0.0
pure_eval 0.2.3
pvlib 0.15.0
pycparser 3.0
pyepw 0.1
Pygments 2.20.0
pyparsing 3.3.2
PySocks 1.7.1
python-dateutil 2.9.0.post0
python-json-logger 4.0.0
pytz 2026.1.post1
pywin32 311
pywinpty 2.0.15
PyYAML 6.0.3
pyzmq 27.1.0
referencing 0.37.0
requests 2.33.1
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rpds-py 0.28.0
scipy 1.17.1
seaborn 0.13.2
Send2Trash 1.8.3
setuptools 82.0.1
six 1.17.0
soupsieve 2.5
stack_data 0.6.3
tenacity 9.1.4
terminado 0.18.1
tinycss2 1.5.1
tornado 6.5.5
tqdm 4.67.3
traitlets 5.14.3
typing_extensions 4.15.0
tzdata 2025.3
urllib3 2.6.3
wcwidth 0.2.14
webencodings 0.5.1
websocket-client 1.8.0
wheel 0.46.3
win_inet_pton 1.1.0
xarray 2025.7.0

Full detail of error message below:
(Python_3_12_13) C:\Users\frank984>python -c "import luxpy as lx; print('LuxPy OK', lx.version)"
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy_init_.py", line 263, in
from luxpy.color.cri import colorrendition as cri
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri_init_.py", line 213, in
from .colorrendition import *
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\colorrendition.py", line 241, in
from .VFPX import VF_PX_models as VFPX
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX_init_.py", line 18, in
from .VF_PX_models import *
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX\VF_PX_models.py", line 94, in
from .vectorshiftmodel import *
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX\vectorshiftmodel.py", line 899, in
_VF_PCOLORSHIFT = initialize_VF_hue_angles(determine_hue_angles = _DETERMINE_HUE_ANGLES, modeltype = _VF_MODEL_TYPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX\vectorshiftmodel.py", line 882, in initialize_VF_hue_angles
outM = VF_colorshift_model(IllC, cri_type = cri_type, sampleset = rflM, vfcolor = 'g',pool = pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX\vectorshiftmodel.py", line 479, in VF_colorshift_model
Rf, Rfi, Jabt, Jabr,cct,duv,cri_type = spd_to_cri(S, cri_type= cri_type,out='Rf,Rfi,jabt,jabr,cct,duv,cri_type', sampleset=sampleset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\utils\helpers.py", line 1447, in spd_to_cri
cct,duv,St,Sr) = spd_to_jab_t_r(St, wl = wl, cri_type = cri_type,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\utils\helpers.py", line 697, in spd_to_jab_t_r
Sr = cri_ref(cct, ref_type = ref_type, cieobs = cieobs['cct'], wl3 = St[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\spectrum\basics\illuminants.py", line 683, in cri_ref
SrBB = blackbody(cct, wl3, n = n)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\spectrum\basics\illuminants.py", line 139, in blackbody
cct = float(cct)
^^^^^^^^^^
TypeError: only 0-dimensional arrays can be converted to Python scalars

(Python_3_12_13) C:\Users\frank984>python -c "import luxpy as lx; print'LuxPy OK', lx.version"
File "", line 1
import luxpy as lx; print'LuxPy OK', lx.version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

(Python_3_12_13) C:\Users\frank984>python -c import luxpy as lx
File "", line 1
import
^
SyntaxError: invalid syntax

(Python_3_12_13) C:\Users\frank984>python -c "import luxpy as lx; print'LuxPy OK', lx.version"
File "", line 1
import luxpy as lx; print'LuxPy OK', lx.version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

(Python_3_12_13) C:\Users\frank984>python -c "import luxpy as lx; print('LuxPy OK', lx.version)"
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy_init_.py", line 263, in
from luxpy.color.cri import colorrendition as cri
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri_init_.py", line 213, in
from .colorrendition import *
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\colorrendition.py", line 241, in
from .VFPX import VF_PX_models as VFPX
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX_init_.py", line 18, in
from .VF_PX_models import *
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX\VF_PX_models.py", line 94, in
from .vectorshiftmodel import *
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX\vectorshiftmodel.py", line 899, in
_VF_PCOLORSHIFT = initialize_VF_hue_angles(determine_hue_angles = _DETERMINE_HUE_ANGLES, modeltype = _VF_MODEL_TYPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX\vectorshiftmodel.py", line 882, in initialize_VF_hue_angles
outM = VF_colorshift_model(IllC, cri_type = cri_type, sampleset = rflM, vfcolor = 'g',pool = pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\VFPX\vectorshiftmodel.py", line 479, in VF_colorshift_model
Rf, Rfi, Jabt, Jabr,cct,duv,cri_type = spd_to_cri(S, cri_type= cri_type,out='Rf,Rfi,jabt,jabr,cct,duv,cri_type', sampleset=sampleset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\utils\helpers.py", line 1447, in spd_to_cri
cct,duv,St,Sr) = spd_to_jab_t_r(St, wl = wl, cri_type = cri_type,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\color\cri\utils\helpers.py", line 697, in spd_to_jab_t_r
Sr = cri_ref(cct, ref_type = ref_type, cieobs = cieobs['cct'], wl3 = St[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\spectrum\basics\illuminants.py", line 683, in cri_ref
SrBB = blackbody(cct, wl3, n = n)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\frank984\anaconda3\envs\Python_3_12_13\Lib\site-packages\luxpy\spectrum\basics\illuminants.py", line 139, in blackbody
cct = float(cct)
^^^^^^^^^^
TypeError: only 0-dimensional arrays can be converted to Python scalars

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions