AttributeError: module 'numpy' has no attribute 'math'. Did you mean: 'emath'?
Opened this issue · 4 comments
Dear aroth85,
Thank you for developing pyclone-vi,
I would like to use the software to caculate CCF from targeted DNA sequencing data. I have performed SNV/INDEL calling and CNV to obtain minor and major cn to run pyclone.
I managed to install pyclone successfully by following the step by step procedure via conda, but when I run:
pyclone-vi fit -i examples/tracerx.tsv -o tracerx.h5 -c 40 -d beta-binomial -r 10 (example run)
I encounter this error message,
"AttributeError: module 'numpy' has no attribute 'math'. Did you mean: 'emath'?"
full log file here:
stderror.txt
How can I deal with it?
Thanks,
Best regards,
Alessio
This should be resolved in PyClone-VI v0.1.5: https://github.com/Roth-Lab/pyclone-vi/releases/tag/0.1.5, 7e34dc8
I have tried with the 0.1.5 version but running the example workflow another error occurred:
Traceback (most recent call last):
File "/home/simone/miniconda3/envs/pyclone-vi/bin/pyclone-vi", line 33, in
sys.exit(load_entry_point('pyclone-vi==0.1.5', 'console_scripts', 'pyclone-vi')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/simone/miniconda3/envs/pyclone-vi/bin/pyclone-vi", line 25, in importlib_load_entry_point
return next(matches).load()
^^^^^^^^^^^^^^^^^^^^
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/importlib/metadata/init.py", line 205, in load
module = import_module(match.group('module'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/site-packages/pyclone_vi-0.1.5-py3.12.egg/pyclone_vi/cli.py", line 3, in
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/site-packages/pyclone_vi-0.1.5-py3.12.egg/pyclone_vi/run.py", line 5, in
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/site-packages/pyclone_vi-0.1.5-py3.12.egg/pyclone_vi/data.py", line 7, in
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/site-packages/pyclone_vi-0.1.5-py3.12.egg/pyclone_vi/math_utils.py", line 9, in
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/site-packages/numba/core/decorators.py", line 225, in wrapper
disp.enable_caching()
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/site-packages/numba/core/dispatcher.py", line 808, in enable_caching
self._cache = FunctionCache(self.py_func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/site-packages/numba/core/caching.py", line 601, in init
self._impl = self._impl_class(py_func)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/site-packages/numba/core/caching.py", line 337, in init
raise RuntimeError("cannot cache function %r: no locator available "
RuntimeError: cannot cache function 'log_beta': no locator available for file '/home/simone/miniconda3/envs/pyclone-vi/lib/python3.12/site-packages/pyclone_vi-0.1.5-py3.12.egg/pyclone_vi/math_utils.py'
That error has to do with numba function caching. I've just pushed changes in v0.1.6 that removes numba caching
Here's what worked for me:
import math
import numpy as np
np.math = math