question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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):

nuitka_testcase.zip

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:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gdementencommented, May 3, 2021

fixed in 0.6.14.5

0reactions
kayhayencommented, Mar 19, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'pip install' fails for every package ("Could not find a version ...
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/setuptools-1.3.1-py2.7.
Read more >
Welcome to pyreadstat's documentation! - GitHub Pages
Each parsing function returns a metadata object in addition to a pandas dataframe. ... dates beyond that will rise an Overflow error in...
Read more >
Pygame <specified object> object is not a callable when trying ...
Error : 'Enemy' object is not callable ... Your mistake is you use the same name for class definiton Enemy and variable in...
Read more >
Installation — pandas 1.5.2 documentation
One way you could be encountering this error is if you have multiple Python installations on your system and you don't have pandas...
Read more >
DLL load failed: The specified module could not be found.
Import fmeobjects from python script error: "ImportError: DLL load failed: ... I've also tried using the python version installed with the extension here:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found