question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name 'getargspec'

See original GitHub issue

I cannot import the package, have the following error message:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-54-1140326dc452> in <module>()
----> 1 from ggplot import *

~/anaconda/lib/python3.6/site-packages/ggplot/__init__.py in <module>()
     18 
     19 from .geoms import geom_area, geom_blank, geom_boxplot, geom_line, geom_point, geom_jitter, geom_histogram, geom_density, geom_hline, geom_vline, geom_bar, geom_abline, geom_tile, geom_rect, geom_bin2d, geom_step, geom_text, geom_path, geom_ribbon, geom_now_its_art, geom_violin, geom_errorbar, geom_polygon
---> 20 from .stats import stat_smooth, stat_density
     21 
     22 from .facets import facet_wrap, facet_grid, Facet

~/anaconda/lib/python3.6/site-packages/ggplot/stats/__init__.py in <module>()
      1 from .stat_density import stat_density
----> 2 from .stat_smooth import stat_smooth

~/anaconda/lib/python3.6/site-packages/ggplot/stats/stat_smooth.py in <module>()
      3 
      4 from ..geoms.geom import geom
----> 5 from . import smoothers
      6 from ..utils import is_date
      7 

~/anaconda/lib/python3.6/site-packages/ggplot/stats/smoothers.py in <module>()
      4 from pandas.lib import Timestamp
      5 import pandas as pd
----> 6 import statsmodels.api as sm
      7 from statsmodels.nonparametric.smoothers_lowess import lowess as smlowess
      8 from statsmodels.sandbox.regression.predstd import wls_prediction_std

~/anaconda/lib/python3.6/site-packages/statsmodels/api.py in <module>()
      3 from . import tools
      4 from .tools.tools import add_constant, categorical
----> 5 from . import regression
      6 from .regression.linear_model import OLS, GLS, WLS, GLSAR
      7 from .regression.recursive_ls import RecursiveLS

~/anaconda/lib/python3.6/site-packages/statsmodels/regression/__init__.py in <module>()
----> 1 from .linear_model import yule_walker
      2 
      3 from statsmodels import NoseWrapper as Tester
      4 test = Tester().test

~/anaconda/lib/python3.6/site-packages/statsmodels/regression/linear_model.py in <module>()
     51                                           cache_readonly,
     52                                           cache_writable)
---> 53 import statsmodels.base.model as base
     54 import statsmodels.base.wrapper as wrap
     55 from statsmodels.emplike.elregress import _ELRegOpts

~/anaconda/lib/python3.6/site-packages/statsmodels/base/model.py in <module>()
      8 from statsmodels.stats.contrast import ContrastResults, WaldTestResults
      9 from statsmodels.tools.decorators import resettable_cache, cache_readonly
---> 10 import statsmodels.base.wrapper as wrap
     11 from statsmodels.tools.numdiff import approx_fprime
     12 from statsmodels.tools.sm_exceptions import ValueWarning, \

~/anaconda/lib/python3.6/site-packages/statsmodels/base/wrapper.py in <module>()
      3 
      4 import numpy as np
----> 5 from statsmodels.compat.python import get_function_name, iteritems, getargspec
      6 
      7 class ResultsWrapper(object):

ImportError: cannot import name 'getargspec'

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

4reactions
pointOfivecommented, Jun 12, 2018

EDIT: solved by restarting kernel 😃

Piling on here 😃

Ran pip install statsmodels --upgrade; then, from statsmodels.stats.outliers_influence import variance_inflation_factor in both command line and jupyter notebook… runs in python, but not in jupyter notebook…


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-109-d8fbd8280798> in <module>()
----> 1 from statsmodels.stats.outliers_influence import variance_inflation_factor

/anaconda2/lib/python2.7/site-packages/statsmodels/stats/outliers_influence.py in <module>()
     11 import numpy as np
     12 
---> 13 from statsmodels.regression.linear_model import OLS
     14 from statsmodels.tools.decorators import cache_readonly
     15 from statsmodels.stats.multitest import multipletests

/anaconda2/lib/python2.7/site-packages/statsmodels/regression/__init__.py in <module>()
----> 1 from .linear_model import yule_walker
      2 
      3 from statsmodels import PytestTester
      4 test = PytestTester()
      5 

/anaconda2/lib/python2.7/site-packages/statsmodels/regression/linear_model.py in <module>()
     46                                           cache_readonly,
     47                                           cache_writable)
---> 48 import statsmodels.base.model as base
     49 import statsmodels.base.wrapper as wrap
     50 from statsmodels.emplike.elregress import _ELRegOpts

/anaconda2/lib/python2.7/site-packages/statsmodels/base/model.py in <module>()
      6 from statsmodels.tools.data import _is_using_pandas
      7 from statsmodels.tools.tools import recipr, nan_dot
----> 8 from statsmodels.stats.contrast import (ContrastResults, WaldTestResults,
      9                                         t_test_pairwise)
     10 from statsmodels.tools.decorators import resettable_cache, cache_readonly

ImportError: cannot import name t_test_pairwise
2reactions
chloechen1995commented, Jan 5, 2018

I also encountered the same issue. I did the upgrade as suggested above. However, I still have the same error. I am using Jupyter notebook with Python 2.0 on a mac. Any suggestion? Thanks in advance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python 3.11 ImportError: cannot import name 'getargspec' from ...
I face the same error. Unable to import from web3 and gives this error message. Using python 3.11 as well.
Read more >
ImportError: cannot import name 'getargspec' from 'inspect' (C ...
Either depreciate python. or go to python3.11/site-packages/parsimonious/expressions.py and replace getargspec with getfullargspec.
Read more >
ImportError: cannot import name getargspec - Hail Discussion
The author of the decorator module pushed a new version to PyPI a few days ago which removed ... ImportError: cannot import name...
Read more >
2021856 – python-bottle fails to build with Python 3.11
Bug 2021856 - python-bottle fails to build with Python 3.11: ImportError: cannot import name 'getargspec' from 'inspect'.
Read more >
importerror cannot import name 'getargspec, importerror cannot ...
importerror cannot import name 'getargspec. inspect.getmodulename (path) ¶ Return the name of the module named by the file path, without including the names ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found