Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading SAV file from your repository does not work :( #47

Open
zenelba opened this issue Jun 17, 2021 · 0 comments
Open

Reading SAV file from your repository does not work :( #47

zenelba opened this issue Jun 17, 2021 · 0 comments

Comments

@zenelba
Copy link

zenelba commented Jun 17, 2021

Hi!

Seems the reading SAV file is the showstopper - did workaround mentioned somewhere:
used pyreadstat and imported dataframe with dataset.from_components(df)

Unfortunately I miss SPSS meta data goodies. BTW is it possible to somehow import pyreadstat META part?

What I get with:
import quantipy as qp
dataset = qp.DataSet("My dataset, wave 1")
dataset.read_spss('"D:/tmp/Example Data (A).sav"')

is an error (using PyCharm and Python 3.7 venv):

Traceback (most recent call last):
File "C:/Users/zbatagelj/PycharmProjects/Valiconer/t.py", line 10, in
dataset.read_spss("D:/tmp/Example Data (B).sav")
File "C:\Users\zbatagelj\quantipy3\quantipy\core\dataset.py", line 601, in read_spss
self._meta, self.data = r_spss(path_sav+'.sav', **kwargs)
File "C:\Users\zbatagelj\quantipy3\quantipy\core\tools\dp\io.py", line 331, in read_spss
meta, data = parse_sav_file(path_sav, **kwargs)
File "C:\Users\zbatagelj\quantipy3\quantipy\core\tools\dp\spss\reader.py", line 40, in parse_sav_file
data = extract_sav_data(filepath, ioLocale=ioLocale, ioUtf8=ioUtf8)
File "C:\Users\zbatagelj\quantipy3\quantipy\core\tools\dp\spss\reader.py", line 48, in extract_sav_data
with sr.SavReader(sav_file, returnHeader=True, ioLocale=ioLocale, ioUtf8=ioUtf8) as reader:
File "C:\Users\zbatagelj\quantipy3\savReaderWriter\savReader.py", line 60, in init
ioUtf8, ioLocale)
File "C:\Users\zbatagelj\quantipy3\savReaderWriter\header.py", line 31, in init
super(Header, self).init(savFileName, ioUtf8, ioLocale)
File "C:\Users\zbatagelj\quantipy3\savReaderWriter\generic.py", line 30, in init
self.libc = cdll.LoadLibrary(ctypes.util.find_library("c"))
File "C:\Users\zbatagelj\AppData\Local\Programs\Python\Python37\lib\ctypes_init
.py", line 442, in LoadLibrary
return self.dlltype(name)
File "C:\Users\zbatagelj\AppData\Local\Programs\Python\Python37\lib\ctypes_init
.py", line 364, in init
self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be str, not None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant