Unable to import package.
thomasgaudelet opened this issue · 2 comments
thomasgaudelet commented
Report
I am unable to import pertpy package. The error message is linked to numpa/numpy interplay
Python 3.10.12 (main, Jun 21 2024, 10:35:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pertpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/__init__.py", line 18, in <module>
from . import plot as pl
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/plot/__init__.py", line 2, in <module>
from pertpy.plot._coda import CodaPlot as coda
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/plot/_coda.py", line 13, in <module>
from pertpy.tools._coda._base_coda import CompositionalModel2
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/tools/__init__.py", line 6, in <module>
from pertpy.tools._differential_gene_expression import DifferentialGeneExpression
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/tools/_differential_gene_expression.py", line 5, in <module>
import decoupler as dc
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/decoupler/__init__.py", line 17, in <module>
from .method_gsva import run_gsva # noqa: F401
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/decoupler/method_gsva.py", line 84, in <module>
def nb_get_D_I(mat):
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/decorators.py", line 232, in wrapper
disp.compile(sig)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/dispatcher.py", line 905, in compile
cres = self._compiler.compile(args, return_type)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/dispatcher.py", line 84, in compile
raise retval
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/dispatcher.py", line 94, in _compile_cached
retval = self._compile_core(args, return_type)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/dispatcher.py", line 107, in _compile_core
cres = compiler.compile_extra(self.targetdescr.typing_context,
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 744, in compile_extra
return pipeline.compile_extra(func)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 438, in compile_extra
return self._compile_bytecode()
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 506, in _compile_bytecode
return self._compile_core()
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 485, in _compile_core
raise e
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 472, in _compile_core
pm.run(self.state)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 368, in run
raise patched_exception
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 356, in run
self._runPass(idx, pass_inst, state)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 311, in _runPass
mutated |= check(pss.run_pass, internal_state)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 273, in check
mangled = func(compiler_state)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/typed_passes.py", line 112, in run_pass
typemap, return_type, calltypes, errs = type_inference_stage(
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/typed_passes.py", line 93, in type_inference_stage
errs = infer.propagate(raise_errors=raise_errors)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/typeinfer.py", line 1091, in propagate
raise errors[0]
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function arange>) found for signature:
>>> arange(start=int64, stop=Literal[int](0), step=Literal[int](-1), dtype=class(float32))
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'np_arange': File: numba/np/arrayobj.py: Line 4760.
With argument(s): '(start=int64, stop=int64, step=int64, dtype=class(float32))':
Rejected as the implementation raised a specific error:
TypingError: 'start' parameter is positional only, but was passed as a keyword
raised from /opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/typing/templates.py:783
During: resolving callee type: Function(<built-in function arange>)
During: typing of call at /opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/decoupler/method_gsva.py (86)
File "../../../opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/decoupler/method_gsva.py", line 86:
def nb_get_D_I(mat):
<source elided>
n = mat.shape[1]
rev_idx = np.abs(np.arange(start=n, stop=0, step=-1, dtype=nb.f4) - n / 2)
^
Version information
session_info 1.0.0
Python 3.10.12 (main, Jun 21 2024, 10:35:36) [GCC 11.4.0]
Linux-5.4.0-162-generic-x86_64-with-glibc2.35
Session information updated at 2024-07-02 16:28
But since I can't load the package this is not really useful...
Here are the versions from pip freeze, (let me know if you'd need more packages)
pertpy==0.7.0 (got the same with 0.6.0)
numpy==1.26.4
numba==0.60.0
Zethson commented
On holidays. Ensure that your decoupler version is the latest and compatible with Numba. They recently fixed it. Look at their repository if necessary, please.
Jul 2, 2024 8:35:57 PM thomasgaudelet ***@***.***>:
…
*Report*
I am unable to import pertpy package. The error message is linked to numpa/numpy interplay
*Python 3.10.12 (main, Jun 21 2024, 10:35:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pertpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/__init__.py", line 18, in <module>
from . import plot as pl
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/plot/__init__.py", line 2, in <module>
from pertpy.plot._coda import CodaPlot as coda
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/plot/_coda.py", line 13, in <module>
from pertpy.tools._coda._base_coda import CompositionalModel2
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/tools/__init__.py", line 6, in <module>
from pertpy.tools._differential_gene_expression import DifferentialGeneExpression
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/pertpy/tools/_differential_gene_expression.py", line 5, in <module>
import decoupler as dc
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/decoupler/__init__.py", line 17, in <module>
from .method_gsva import run_gsva # noqa: F401
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/decoupler/method_gsva.py", line 84, in <module>
def nb_get_D_I(mat):
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/decorators.py", line 232, in wrapper
disp.compile(sig)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/dispatcher.py", line 905, in compile
cres = self._compiler.compile(args, return_type)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/dispatcher.py", line 84, in compile
raise retval
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/dispatcher.py", line 94, in _compile_cached
retval = self._compile_core(args, return_type)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/dispatcher.py", line 107, in _compile_core
cres = compiler.compile_extra(self.targetdescr.typing_context,
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 744, in compile_extra
return pipeline.compile_extra(func)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 438, in compile_extra
return self._compile_bytecode()
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 506, in _compile_bytecode
return self._compile_core()
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 485, in _compile_core
raise e
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler.py", line 472, in _compile_core
pm.run(self.state)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 368, in run
raise patched_exception
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 356, in run
self._runPass(idx, pass_inst, state)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 311, in _runPass
mutated |= check(pss.run_pass, internal_state)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 273, in check
mangled = func(compiler_state)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/typed_passes.py", line 112, in run_pass
typemap, return_type, calltypes, errs = type_inference_stage(
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/typed_passes.py", line 93, in type_inference_stage
errs = infer.propagate(raise_errors=raise_errors)
File "/opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/typeinfer.py", line 1091, in propagate
raise errors[0]
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function arange>) found for signature:
>>> arange(start=int64, stop=Literal[int](0), step=Literal[int](-1), dtype=class(float32))
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'np_arange': File: numba/np/arrayobj.py: Line 4760.
With argument(s): '(start=int64, stop=int64, step=int64, dtype=class(float32))':
Rejected as the implementation raised a specific error:
TypingError: 'start' parameter is positional only, but was passed as a keyword
raised from /opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/numba/core/typing/templates.py:783
During: resolving callee type: Function(<built-in function arange>)
During: typing of call at /opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/decoupler/method_gsva.py (86)
File "../../../opt/pyenv/versions/3.10.12/lib/python3.10/site-packages/decoupler/method_gsva.py", line 86:
def nb_get_D_I(mat):
<source elided>
n = mat.shape[1]
rev_idx = np.abs(np.arange(start=n, stop=0, step=-1, dtype=nb.f4) - n / 2)
^
*
*Version information*
----------------------------------------
*session_info 1.0.0*
*Python 3.10.12 (main, Jun 21 2024, 10:35:36) [GCC 11.4.0]
Linux-5.4.0-162-generic-x86_64-with-glibc2.35*
Session information updated at 2024-07-02 16:28
But since I can't load the package this is not really useful...
Here are the versions from pip freeze, (let me know if you'd need more packages)
pertpy==0.7.0 (got the same with 0.6.0)
numpy==1.26.4
numba==0.60.0
—
Reply to this email directly, view it on GitHub[#632], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AFHQA2HJ67JJZH3CN7OECJDZKLCFXAVCNFSM6AAAAABKH2CQCOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4DMNJYGIZDAMY].
You are receiving this because you are subscribed to this thread.
[Tracking image][https://github.com/notifications/beacon/AFHQA2GDSGN3BDDBUQ3X6RTZKLCFXA5CNFSM6AAAAABKH2CQCOWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHI4QC2XM.gif]
thomasgaudelet commented
Thanks, that was it. Enjoy your holidays!