biblicalhumanities / greek-new-testament

Greek New Testament
45 stars 18 forks source link

Bad Magic Number #36

Open AdamDenoon opened 4 years ago

AdamDenoon commented 4 years ago

On macOS 10.14.6, using python 3.7.4, I'm receiving the following error when I attempt to run the first block of code:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-801ea7d0d0f4> in <module>
----> 1 from greeksyntax.lowfat import *
      2 
      3 q = lowfat("nestle1904lowfat")

ImportError: bad magic number in 'greeksyntax': b'\x03\xf3\r\n'

image

Any clues?

jonathanrobie commented 4 years ago

Did you get this to work? Sadly, I wasn't monitoring this. On my Mac, I don't have this problem:

Python 3.6.8 |Anaconda custom (64-bit)| (default, Dec 29 2018, 19:04:46) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from greeksyntax.lowfat import *
>>> q = lowfat("nestle1904lowfat")
Database 'nestle1904lowfat' was opened in 13.82 ms.

I think that bad magic number normally means that you (or someone else) compiled the library with one version of Python and are now importing it using a different version of Python.

See this explanation:

https://stackoverflow.com/questions/514371/whats-the-bad-magic-number-error?rq=1

So if you compile the library with your current Python and install it, you should be able to import without difficulty. Let me know if that fixes the error for you.