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

Backports error #432

Open
obrien-james opened this issue Sep 25, 2024 · 4 comments
Open

Backports error #432

obrien-james opened this issue Sep 25, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@obrien-james
Copy link

obrien-james commented Sep 25, 2024

Description of the bug

When running session_info.show() when dandelion has been imported raises an error:

Cell In[2], line 2
      1 #Output session Info
----> 2 session_info.show()

File ~/rds/hpc-work/conda_envs/new_bio/lib/python3.11/site-packages/session_info/main.py:209, in show(na, os, cpu, jupyter, dependencies, std_lib, private, write_req_file, req_file_name, html, excludes)
    207 for mod_name in clean_modules:
    208     mod_names.append(mod_name)
--> 209     mod = sys.modules[mod_name]
    210     # Since modules use different attribute names to store version info,
    211     # try the most common ones.
    212     try:

KeyError: 'backports'

Minimal reproducible example

#Standard Imports:
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib as mpl

import scanpy as sc
import dandelion as ddl
import pingouin as pg

import session_info

#Output session Info
session_info.show()

The error message produced by the code above

---------------------------------------------------------------------------
KeyError                          Traceback (most recent call last)
Cell In[2], line 2
      1 #Output session Info
----> 2 session_info.show()

File ~/rds/hpc-work/conda_envs/new_bio/lib/python3.11/site-packages/session_info/main.py:209, in show(na, os, cpu, jupyter, dependencies, std_lib, private, write_req_file, req_file_name, html, excludes)
    207 for mod_name in clean_modules:
    208     mod_names.append(mod_name)
--> 209     mod = sys.modules[mod_name]
    210     # Since modules use different attribute names to store version info,
    211     # try the most common ones.
    212     try:

KeyError: 'backports'

OS information

HPC cluster

Version information

scanpy==1.10.3 anndata==0.10.8 umap==0.5.6 numpy==2.0.2 scipy==1.14.1 pandas==2.2.3 scikit-learn==1.5.2 statsmodels==0.14.3 igraph==0.11.6 pynndescent==0.5.13

dandelion==0.3.8 pandas==2.2.3 numpy==1.26.4 matplotlib==3.9.2 networkx==3.3 scipy==1.14.1

Additional context

This is definitely caused only if importing dandelion. I have worked through each import and run session_info.show() and do not get this error until dandelion is imported.

@obrien-james obrien-james added the bug Something isn't working label Sep 25, 2024
@zktuong
Copy link
Owner

zktuong commented Sep 25, 2024

hi there, i'm not sure what's happening since backports is not a dependency in dandelion

@zktuong
Copy link
Owner

zktuong commented Oct 4, 2024

but just in case, can you report back what you see with pip show backports?

For example with anndata:

pip show anndata

Name: anndata
Version: 0.10.9
Summary: Annotated data.
Home-page: https://github.com/scverse/anndata
Author: Philipp Angerer, Alex Wolf, Isaac Virshup, Sergei Rybakov
Author-email: 
License: 
Location: /opt/homebrew/Caskroom/mambaforge/base/envs/dandelion/lib/python3.11/site-packages
Requires: array-api-compat, h5py, natsort, numpy, packaging, pandas, scipy
Required-by: anndata2ri, infercnvpy, kttools, milopy, mudata, palantir, sc-dandelion, scanpy, scFates, scirpy

@obrien-james
Copy link
Author

I use conda to manage my environment (mainly).
pip show backoports reports WARNING: Package(s) not found: backports

conda list backports reports:

# Name                    Version                   Build  Channel
backports                 1.0                pyhd8ed1ab_4    conda-forge

@zktuong
Copy link
Owner

zktuong commented Oct 4, 2024

how about
conda-tree whoneeds backports
https://anaconda.org/conda-forge/conda-tree

anyway, it's not an issue with dandelion:

>>> import dandelion
>>> import session_info
>>> session_info.show()
-----
dandelion           0.4.1.dev2
session_info        1.0.0
-----
Python 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:34:54) [Clang 16.0.6 ]
macOS-14.4-arm64-arm-64bit
-----
Session information updated at 2024-10-05 08:18

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

2 participants