errors using pyreadstat with --standalone
See original GitHub issue- Please check out if the develop version of Nuitka works better for you.
Did not test that as I got 0.6.12, which is not even tagged yet on Github (but does exist on pypi???) so I guess I am running develop already.
- Nuitka version, full Python version and Platform (Windows, OSX, Linux …)
nuitka --version 0.6.12 Python: 3.9.1 (default, Dec 11 2020, 09:29:25) [MSC v.1916 64 bit (AMD64)] Executable: C:\soft\Miniconda3x64\envs\sas2csv-nuitka\python.exe OS: Windows Arch: x86_64
- How did you install Nuitka and Python
conda create -n sas2csv-nuitka python pytz python-dateutil six activate sas2csv-nuitka pip install pandas # installs numpy too pip install pyreadstat pip install nuitka
- Many times when you get an error from Nuitka, your setup may be special
a program with just print(“hello world”) works fine when compiled with --standalone
- SSCCE (this is equivalent to test.py in the .zip file, sample.sas7bdat is also in the zip file):
import pyreadstat
if __name__ == '__main__':
df, meta = pyreadstat.read_sas7bdat('sample.sas7bdat')
df.to_csv('sample.csv')
compiles fine using either --standalone or --onefile and ultimately produces the following traceback at runtime:
Traceback (most recent call last):
File "C:\Users\gdm\AppData\Local\Test\test\001~1.0\test.py", line 3, in <module>
import pyreadstat
File "C:\Users\gdm\AppData\Local\Test\test\001~1.0\pyreadstat\__init__.py", line 17, in <module pyreadstat>
File "pyreadstat\pyreadstat.pyx", line 1, in init pyreadstat.pyreadstat
File "pyreadstat\_readstat_parser.pyx", line 28, in init pyreadstat._readstat_parser
ModuleNotFoundError: No module named 'pandas'
Adding an explicit “import pandas” like below (test2.py in the zip file) gets me seemingly further…
import pyreadstat
import pandas
if __name__ == '__main__':
df, meta = pyreadstat.read_sas7bdat('sample.sas7bdat')
df.to_csv('sample.csv')
… but ultimately crashes at runtime too with:
Traceback (most recent call last):
File "C:\Users\gdm\devel\NUITKA~1\TEST2~1.DIS\test2.py", line 3, in <module>
File "C:\Users\gdm\devel\NUITKA~1\TEST2~1.DIS\pyreadstat\__init__.py", line 17, in <module pyreadstat>
File "pyreadstat\pyreadstat.pyx", line 1, in init pyreadstat.pyreadstat
ModuleNotFoundError: No module named 'pyreadstat._readstat_writer'
I have tried copying _readstat_writer.cp39-win_amd64.pyd from pyreadstat’s directory to test2.dist\pyreadstat\ with or without renaming it to _readstat_writer.pyd but it does not seem to change anything, so I am out of ideas to solve this.
- The specific PyPI names and versions
python -m pip freeze Nuitka==0.6.12 numpy==1.20.1 pandas==1.2.1 pyreadstat==1.0.8
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
fixed in 0.6.14.5
I think it is, and you can basically see the one importing and use that as the implicit dependency. Since it says
.pyx
in the source code, that’s something that Nuitka isn’t able to look into, and they don’t have the.pyi
file it would take.