vlouf/dealias

ERROR: Failed building wheel for numba

Closed this issue ยท 3 comments

Hi,

I have been unsuccessful at installing the package in an existing as well as a new conda environment.

I tried installing it using these two ways:

pip install unravel

git clone https://github.com/vlouf/dealias.git, and cd delias
pip install -e .

Both the approaches end up failing in the build numba step.

Here is the relevant output (I think) from the log file:

2021-02-10T15:40:14,757 Collecting numba<=0.46
2021-02-10T15:40:14,758 Created temporary directory: /private/var/folders/dx/2slpy9fn6qn_whyp5vv0l46w0000gn/T/pip-unpack-utui_ig1
2021-02-10T15:40:14,782 Downloading numba-0.46.0.tar.gz (1.9 MB)
2021-02-10T15:40:15,458 Added numba<=0.46 from https://files.pythonhosted.org/packages/33/6f/47d87ded23f3d1aa1e221d75278caf427e8da80649c14312172857bad64f/numba-0.46.0.tar.gz#sha256=c2cbaeae60f80805290fff50175028726fae12692404a36babd3326730fbceee (from unravel) to build tracker '/private/var/folders/dx/2slpy9fn6qn_whyp5vv0l46w0000gn/T/pip-req-tracker-0dk4hs4l'
2021-02-10T15:40:15,458 Running setup.py (path:/private/var/folders/dx/2slpy9fn6qn_whyp5vv0l46w0000gn/T/pip-install-nr52lxxk/numba_7775be5e1d924784ae5b88bcd97a7bc2/setup.py) egg_info for package numba
2021-02-10T15:40:15,458 Created temporary directory: /private/var/folders/dx/2slpy9fn6qn_whyp5vv0l46w0000gn/T/pip-pip-egg-info-s3ot2q0k
2021-02-10T15:40:15,458 Running command python setup.py egg_info
2021-02-10T15:40:15,710 running egg_info
.
.
.
.
2021-02-10T15:40:22,277 pip._internal.exceptions.InstallationSubprocessError: Command errored out with exit status 1: /anaconda3/envs/dealias/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/dx/2slpy9fn6qn_whyp5vv0l46w0000gn/T/pip-install-nr52lxxk/numba_7775be5e1d924784ae5b88bcd97a7bc2/setup.py'"'"'; file='"'"'/private/var/folders/dx/2slpy9fn6qn_whyp5vv0l46w0000gn/T/pip-install-nr52lxxk/numba_7775be5e1d924784ae5b88bcd97a7bc2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/dx/2slpy9fn6qn_whyp5vv0l46w0000gn/T/pip-record-lz0wg96s/install-record.txt --single-version-externally-managed --compile --install-headers /anaconda3/envs/dealias/include/python3.8/numba Check the logs for full command output.
2021-02-10T15:40:22,327 Removed build tracker: '/private/var/folders/dx/2slpy9fn6qn_whyp5vv0l46w0000gn/T/pip-req-tracker-0dk4hs4l'

After some debugging, I realized that at least the issue with installing unrvael in a completely new conda environment has something to do with the order in which packages are installed. Steps followed to reproduce the error:

conda create -n dealias python=3.8 #(same behavior noticed with python=3.7)

python -m pip install unravel

This will still throw the following error:

ERROR: Failed cleaning build dir for numba
Failed to build numba
Installing collected packages: numpy, llvmlite, numba, unravel
Running setup.py install for numba ... done
DEPRECATION: numba was installed using the legacy 'setup.py install' method, because a wheel could not be built for it. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at pypa/pip#8368.
Successfully installed llvmlite-0.36.0rc1 numba-0.46.0 numpy-1.20.1 unravel-1.0.0

However, listing out the installed packages python -m pip list produces this list:

python -m pip list
Package    Version
---------- -------------------
certifi    2020.12.5
llvmlite   0.36.0rc1
numba      0.46.0
numpy      1.20.1
pip        21.0.1
setuptools 49.6.0.post20210108
unravel    1.0.0
wheel      0.36.2

Now, starting a python session from terminal $python and typing import unravel produces this error:

In [1]: import unravel

TypeError Traceback (most recent call last)
in
----> 1 import unravel

/anaconda3/envs/dealias/lib/python3.7/site-packages/unravel/init.py in
----> 1 from .dealias import unravel_3D_pyart, unravel_3D_pyodim, dealias_long_range, dealiasing_process_2D

/anaconda3/envs/dealias/lib/python3.7/site-packages/unravel/dealias.py in
15 import numpy as np
16
---> 17 from . import continuity
18 from . import filtering
19 from . import initialisation

/anaconda3/envs/dealias/lib/python3.7/site-packages/unravel/continuity.py in
14 """
15 import numpy as np
---> 16 from numba import jit, int64, float64
17
18

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/init.py in
45
46 # Initialize typed containers
---> 47 import numba.typed
48
49 # Enable bytes/unicode array support (Python 3.x only)

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/typed/init.py in
1 from future import absolute_import
2
----> 3 from .typeddict import Dict
4 from .typedlist import List

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/typed/typeddict.py in
16
17
---> 18 @njit
19 def _make_dict(keyty, valty):
20 return dictobject._as_meminfo(dictobject.new_dict(keyty, valty))

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/decorators.py in njit(*args, **kws)
237 warnings.warn('forceobj is set for njit and is ignored', RuntimeWarning)
238 kws.update({'nopython': True})
--> 239 return jit(*args, **kws)
240
241

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/decorators.py in jit(signature_or_function, locals, target, cache, pipeline_class, **options)
174 targetoptions=options, **dispatcher_args)
175 if pyfunc is not None:
--> 176 return wrapper(pyfunc)
177 else:
178 return wrapper

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/decorators.py in wrapper(func)
190 disp = dispatcher(py_func=func, locals=locals,
191 targetoptions=targetoptions,
--> 192 **dispatcher_args)
193 if cache:
194 disp.enable_caching()

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/dispatcher.py in init(self, py_func, locals, targetoptions, impl_kind, pipeline_class)
648 """
649 self.typingctx = self.targetdescr.typing_context
--> 650 self.targetctx = self.targetdescr.target_context
651
652 pysig = utils.pysignature(py_func)

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/targets/registry.py in target_context(self)
48 return nested
49 else:
---> 50 return self._toplevel_target_context
51
52 @Property

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/utils.py in get(self, instance, type)
388 if instance is None:
389 return self
--> 390 res = instance.dict[self.name] = self.func(instance)
391 return res
392

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/targets/registry.py in _toplevel_target_context(self)
32 def _toplevel_target_context(self):
33 # Lazily-initialized top-level target context, for all threads
---> 34 return cpu.CPUContext(self.typing_context)
35
36 @utils.cached_property

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/targets/base.py in init(self, typing_context)
248
249 # Initialize
--> 250 self.init()
251
252 def init(self):

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs)
30 def _acquire_compile_lock(*args, **kwargs):
31 with self:
---> 32 return func(*args, **kwargs)
33 return _acquire_compile_lock
34

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/targets/cpu.py in init(self)
49 def init(self):
50 self.is32bit = (utils.MACHINE_BITS == 32)
---> 51 self._internal_codegen = codegen.JITCPUCodegen("numba.exec")
52
53 # Add ARM ABI functions from libgcc_s

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/targets/codegen.py in init(self, module_name)
610 self._llvm_module.name = "global_codegen_module"
611 self._rtlinker = RuntimeLinker()
--> 612 self._init(self._llvm_module)
613
614 def _init(self, llvm_module):

/anaconda3/envs/dealias/lib/python3.7/site-packages/numba/targets/codegen.py in _init(self, llvm_module)
619 self._tm_features = self._customize_tm_features()
620 self._customize_tm_options(tm_options)
--> 621 tm = target.create_target_machine(**tm_options)
622 engine = ll.create_mcjit_compiler(llvm_module, tm)
623

TypeError: create_target_machine() got an unexpected keyword argument 'jitdebug'

vlouf commented

Hi,

Can you install numba using conda? i.e.:
conda install numba

And then install unravel using the latest git version doing:
pip install git+https://github.com/vlouf/dealias.git

Cheers

Amazing @vlouf! Yes, it worked. Can confirm that unravel installs perfectly in both pre-existing and new conda envs this way with or w/o Python 3.8