1

I am trying to read a hdf5 file using Pandas, but getting this error:

ValueError: invalid literal for int() with base 10: '5,3,2'

I am only calling data = pd.read_hdf(path), so I have like no idea what can I change.

The file should be ok, it can be read using pyCGNS package, but I would like to do it by pandas.

The full output is:

runfile('D:/projekty/CGNS_Read/untitled3.py', wdir='D:/projekty/CGNS_Read')
Traceback (most recent call last):

  File C:\Program Files\Spyder\pkgs\spyder_kernels\py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File d:\projekty\cgns_read\untitled3.py:19
    data = pd.read_hdf(path + name)

  File C:\Program Files\Spyder\pkgs\pandas\io\pytables.py:420 in read_hdf
    store = HDFStore(path_or_buf, mode=mode, errors=errors, **kwargs)

  File C:\Program Files\Spyder\pkgs\pandas\io\pytables.py:560 in __init__
    tables = import_optional_dependency("tables")

  File C:\Program Files\Spyder\pkgs\pandas\compat\_optional.py:142 in import_optional_dependency
    module = importlib.import_module(name)

  File importlib\__init__.py:127 in import_module

  File <frozen importlib._bootstrap>:1014 in _gcd_import

  File <frozen importlib._bootstrap>:991 in _find_and_load

  File <frozen importlib._bootstrap>:975 in _find_and_load_unlocked

  File <frozen importlib._bootstrap>:671 in _load_unlocked

  File <frozen importlib._bootstrap_external>:848 in exec_module

  File <frozen importlib._bootstrap>:219 in _call_with_frames_removed

  File C:\Program Files\Spyder\Python\lib\site-packages\tables\__init__.py:100
    from .file import File, open_file, copy_file

  File C:\Program Files\Spyder\Python\lib\site-packages\tables\file.py:20
    import numexpr as ne

  File C:\Program Files\Spyder\Python\lib\site-packages\numexpr\__init__.py:44
    nthreads = _init_num_threads()

  File C:\Program Files\Spyder\Python\lib\site-packages\numexpr\utils.py:156 in _init_num_threads
    requested_threads = int(os.environ['OMP_NUM_THREADS'])

ValueError: invalid literal for int() with base 10: '5,3,2'
Galedon
  • 21
  • 3

1 Answers1

0

Ok, problem solved. For anybody who will deal with the same problem, the solution was:

pip install --upgrade python-utils

which is a dependency for tables (or pytables) which is a dependency for pandas.

Galedon
  • 21
  • 3
  • ValueError is raised as the number format is incorrect, which is nothing to do with the version. Maybe edit the question? – Mr. Hobo May 30 '23 at 17:24
  • Well, that was what I thought, but I tried to change the env. value - it just started to raise a different error. After the update it works with both formats of the value. – Galedon May 31 '23 at 18:29