ImportError: cannot import name 'float_factorial' from 'scipy._lib._util'
Dear all, I am trying to run a jupyter notebook to analyze spatial transcriptomics data and when I want to import segmentation I receive error for scipy.lib_util: ``` Here is a chunk that I import libraries: import scanpy as sc import numpy as np import matplotlib.pyplot as plt import scipy as scp import seaborn as sns import pandas as pd import urllib import tangram as tg import segmentation as segmentation``` **ImportError: cannot import name 'float_factorial' from 'scipy._lib._util'**. I googled and found only one specific answer which had recommended to edit the function 'float_factorial' Here is the link https://stackoverflow.com/questions/66647283/importerror-cannot-import-name-... I edited as suggested but didn't help unfortunately :(. I will very appreciate if you can help to fix this issue! Regards, Nima
On Thu, Jul 13, 2023, at 10:36, Nima Rafati wrote:
Dear all,
I am trying to run a jupyter notebook to analyze spatial transcriptomics data and when I want to import segmentation I receive error for scipy.lib_util: ``` Here is a chunk that I import libraries: import scanpy as sc import numpy as np import matplotlib.pyplot as plt import scipy as scp import seaborn as sns import pandas as pd import urllib import tangram as tg import segmentation as segmentation```
**ImportError: cannot import name 'float_factorial' from 'scipy._lib._util'**.
Hi, It's hard to say anything certain with all those imports and no traceback. Generally speaking, it looks like one of those packages uses private SciPy functionality that isn't present in your current environment (as it can often happen when one relies on private functionality). The function in question seems to have been added in PR #12668 (https://github.com/scipy/scipy/pull/12668/files) 3 years ago and it looks like it's still there. So perhaps your SciPy is too old considering another package you're trying to use. In any case this seems like an issue of a package other than SciPy (the offending package should specify a minimal SciPy dependency version that matches the functionality it's using). If you look at the traceback you get you'll be able to see exactly where the problem is coming from (what package, what lines of code). And looking at the package versions in your environment can help you figure out where the version mismatch is coming from. If your SciPy is version 1.5.2 or older you probably just have to upgrade it. Good luck, AndrĂ¡s
I googled and found only one specific answer which had recommended to edit the function 'float_factorial' Here is the link https://stackoverflow.com/questions/66647283/importerror-cannot-import-name-... I edited as suggested but didn't help unfortunately :(.
I will very appreciate if you can help to fix this issue!
Regards, Nima _______________________________________________ SciPy-Dev mailing list -- scipy-dev@python.org To unsubscribe send an email to scipy-dev-leave@python.org https://mail.python.org/mailman3/lists/scipy-dev.python.org/ Member address: deak.andris@gmail.com
participants (2)
-
Andras Deak -
Nima Rafati