Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after i pip install infercnvpy , when i run "import infercnvpy" , my ipykernel always dies. #145

Open
Gossipforever opened this issue Nov 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Gossipforever
Copy link

Report

like this
微信图片_20241101151301

Version information

No response

@Gossipforever Gossipforever added the bug Something isn't working label Nov 1, 2024
@Gossipforever Gossipforever changed the title after i pip install infercnvpy , my ipykernel always dies. after i pip install infercnvpy , when i run "import infercnvpy" , my ipykernel always dies. Nov 1, 2024
@grst
Copy link
Member

grst commented Nov 1, 2024

This can have a lot of reasons. You'll need to check you jupyter logs to find out more.

@Gossipforever
Copy link
Author

image

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.2 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/infercnvpy/__init__.py", line 5, in <module>
    from . import datasets, io, pl, pp, tl
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/infercnvpy/datasets/__init__.py", line 5, in <module>
    import scanpy as sc
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/scanpy/__init__.py", line 20, in <module>
    from ._utils import check_versions
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/scanpy/_utils/__init__.py", line 27, in <module>
    from anndata import __version__ as anndata_version
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/anndata/__init__.py", line 24, in <module>
    from ._core.anndata import AnnData
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/anndata/_core/anndata.py", line 18, in <module>
    import pandas as pd
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/pandas/__init__.py", line 26, in <module>
    from pandas.compat import (
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/pandas/compat/__init__.py", line 27, in <module>
    from pandas.compat.pyarrow import (
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/pandas/compat/pyarrow.py", line 8, in <module>
    import pyarrow as pa
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/pyarrow/__init__.py", line 65, in <module>
    import pyarrow.lib as _lib
AttributeError: _ARRAY_API not found

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.2 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/infercnvpy/__init__.py", line 5, in <module>
    from . import datasets, io, pl, pp, tl
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/infercnvpy/datasets/__init__.py", line 5, in <module>
    import scanpy as sc
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/scanpy/__init__.py", line 20, in <module>
    from ._utils import check_versions
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/scanpy/_utils/__init__.py", line 27, in <module>
    from anndata import __version__ as anndata_version
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/anndata/__init__.py", line 24, in <module>
    from ._core.anndata import AnnData
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/anndata/_core/anndata.py", line 18, in <module>
    import pandas as pd
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/pandas/__init__.py", line 49, in <module>
    from pandas.core.api import (
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/pandas/core/api.py", line 9, in <module>
    from pandas.core.dtypes.dtypes import (
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/pandas/core/dtypes/dtypes.py", line 24, in <module>
    from pandas._libs import (
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/testi/lib/python3.11/site-packages/pyarrow/__init__.py", line 65, in <module>
    import pyarrow.lib as _lib
AttributeError: _ARRAY_API not found``

then the kernel died and restart, i try to change numpy‘s version,and then it has no error but died directly。

@grst
Copy link
Member

grst commented Nov 4, 2024

To me this looks a bit like your conda environment is corrupted, possibly by repeatedly installing new packages into it via pip.

I strongly recommend you start creating separate virtual environments for each project. By using the nb_conda_kernels package, these venvs will appear as different kernels in jupyter lab.

@Bioin-Mixologist
Copy link

Bioin-Mixologist commented Nov 12, 2024

Changing the installation content might solve the problem.
I encountered similar issues when I installed scanpy, bbknn, and then infercnvpy.
By changing to install only infercnv, the error no longer occurs (only warnings remain).
Here is my installation code:

conda create --name scCNV python=3.10
conda activate scCNV
pip install infercnvpy
conda install ipykernel
pip install ipympl
ipython kernel install --user --name=scCNV-kernel
conda deactivate

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants