1

This issue is appearing in a local Jupyter notebook and I'm using Python 3.10

Importing scipy and scipy.stats is no problem.

import scipy
import scipy.stats

However, I'm trying to use the Pingouin library for data analysis and running into issues with the following code:

import pingouin as pg
pg.ttest(x,y,paired=True)

--> 201 from scipy.stats.stats import (_unequal_var_ttest_denom,
    202                                _equal_var_ttest_denom)

ImportError: cannot import name '_unequal_var_ttest_denom' from 'scipy.stats.stats'
(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scipy/stats/stats.py)

Since Pingouin is SciPy dependent, it's trying to import the required modules and getting stuck on at least one. I've tried uninstalling and reinstalling SciPy and Pingouin but am unable to resolve this issue. Any advice is greatly appreciated!

Muhammad Mohsin Khan
  • 1,444
  • 7
  • 16
  • 23
  • 1
    It is a known [`pingouin` issue](https://github.com/raphaelvallat/pingouin/issues/232). `pingouin` should not have been importing private names from `scipy`. – Warren Weckesser Feb 09 '22 at 18:05
  • If you need place to work until that issue gets sorted and you don't have security or size of data concerns, I just tested your second block of code (left off your first bock) with pingouin 0.5.0 and scipy 1.7.3 by launching a browser-based Jupyter session served via MyBinder by clicking [here](http://mybinder.org/v2/gh/fomightez/pythonista_skewedf/master?filepath=index.ipynb) and running `%pip install pingouin` in a cell before trying your second block of code. – Wayne Feb 09 '22 at 19:16

0 Answers0