msgpack._packer does not exist in anaconda installation

1.2k views Asked by At

I've recently changed my python installation from python xy to anaconda 64 bit on windows 7. I tried to start an application that I built that uses msgpack-python and msgpack-numpy, but all of a sudden msgpack-numpy throws an error when it is imported.

In [2]: import msgpack_numpy
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-4f549c7ad545> in <module>()
----> 1 import msgpack_numpy

C:\Anaconda\lib\site-packages\msgpack_numpy.py in <module>()
      7 import numpy as np
      8 import msgpack
----> 9 import msgpack._packer as _packer
     10 import msgpack._unpacker as _unpacker
     11

ImportError: No module named _packer

I've checked, my version of msgpack (0.4.2) does not have an attribute called _packer or _unpacker. The weird thing is that on another computer that I have that still runs python xy, the msgpack module (also version 0.4.2) does have these attributes!

Any clues how I can solve this? Is it a 64 bit issue somehow?

1

There are 1 answers

0
jkokorian On

Turns out the msgpack library was built without cython. When running pip install I got the following error:

collect2.exe: error: ld returned 1 exit status
WARNING: Failed to compile extensiom modules.
msgpack uses fallback pure python implementation.
command 'C:\\MinGW\\bin\\g++.exe' failed with exit status 1
cythonize: 'msgpack/_packer.pyx'
cythonize: 'msgpack/_unpacker.pyx'

warning: no files found matching '*.c' under directory 'msgpack'
Successfully installed msgpack-python
Cleaning up...

I will look into it. Apparently _packer and _unpacker are 'extension modules' that were not built correctly and I now have a pure python version without them.