pyreadr icon indicating copy to clipboard operation
pyreadr copied to clipboard

DLL load failed while importing librdata: The specified module could not be found.

Open Kmuawetfae opened this issue 3 years ago • 2 comments

Hi, I just installed pyreadr, netCDF4, and other libraries. but, when I tried to import pyreadr and only pyreadr it gave me this error. c:\Users\Master\OneDrive - Yayasan Agri Sustineri Indonesia\Product Dev\Training Wycliffe\ERA5\script\ERA5 extract code.ipynb Cell 1 in <cell line: 4>() 2 import numpy as np 3 import json #deal with json file ----> 4 import pyreadr #deal with rdata 5 import netCDF4 as nc 6 import xarray as xr

File ~\AppData\Roaming\Python\Python310\site-packages\pyreadr_init_.py:1, in ----> 1 from .pyreadr import read_r, list_objects, write_rds, write_rdata, download_file 2 from .custom_errors import PyreadrError, LibrdataError 4 version = "0.4.6"

File ~\AppData\Roaming\Python\Python310\site-packages\pyreadr\pyreadr.py:10, in 6 from urllib.request import urlopen 8 import pandas as pd ---> 10 from ._pyreadr_parser import PyreadrParser, ListObjectsParser 11 from ._pyreadr_writer import PyreadrWriter 12 from .custom_errors import PyreadrError

File ~\AppData\Roaming\Python\Python310\site-packages\pyreadr_pyreadr_parser.py:17, in 14 except: 15 pass ---> 17 from .librdata import Parser 18 from .custom_errors import PyreadrError 22 class Table:

ImportError: DLL load failed while importing librdata: The specified module could not be found.

I am using VS.code with jupyter extension and I install the libraries with pip3. My python version is Python 3.10.0

Kmuawetfae avatar Jul 29 '22 03:07 Kmuawetfae

Hi, you have to locate where the dll files where copied and copy them manually to the pyreadr folder or add this folder wirh os.add_dll_folder. You can also download the dll files from thus repo (folder win_libs) and again either copy them to the pyreadr folder or add the folder where they are with os.

Look at this issue for a longer discussion. https://github.com/Roche/pyreadstat/issues/179

ofajardo avatar Jul 29 '22 06:07 ofajardo

and look also for the solution for pyreadr here #72

ofajardo avatar Aug 05 '22 15:08 ofajardo

duplicated of #72

ofajardo avatar Jul 19 '23 09:07 ofajardo