Import error in Rec Model

I'm getting the error "cannot import name moduleTNC" when I try to import the recmodel_client in a Python script.  It had been working fine until last week.  Any suggestions?  Thanks.

Comments

  • jdouglassjdouglass Administrator, NatCap Staff
    HI @panellio, could you include the full text of the exception including the traceback?  That'll help a ton with pinpointing where the error is occurring.

    Thanks!
    James
  • paniellopaniello Member
    Hi James, thanks for the response, here's the full text of the exception:

    Traceback (most recent call last):
      File "X:/GIS_PROJECTS/NATIONAL/ParkServe/CustomProjects/UW_NatCap/pa_flickr_test.py", line 1, in <module>
        import natcap.invest.recreation.recmodel_client
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\natcap\invest\__init__.py", line 8, in <module>
        import natcap.invest.pygeoprocessing_0_3_3
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\natcap\invest\pygeoprocessing_0_3_3\__init__.py", line 9, in <module>
        from geoprocessing import *
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\natcap\invest\pygeoprocessing_0_3_3\geoprocessing.py", line 24, in <module>
        import scipy.interpolate
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\scipy\interpolate\__init__.py", line 175, in <module>
        from .interpolate import *
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\scipy\interpolate\interpolate.py", line 21, in <module>
        import scipy.special as spec
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\scipy\special\__init__.py", line 648, in <module>
        from ._ellip_harm import ellip_harm, ellip_harm_2, ellip_normal
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\scipy\special\_ellip_harm.py", line 7, in <module>
        from ._ellip_harm_2 import _ellipsoid, _ellipsoid_norm
      File "_ellip_harm_2.pyx", line 7, in init scipy.special._ellip_harm_2
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\scipy\integrate\__init__.py", line 93, in <module>
        from ._bvp import solve_bvp
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\scipy\integrate\_bvp.py", line 11, in <module>
        from scipy.optimize import OptimizeResult
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\scipy\optimize\__init__.py", line 241, in <module>
        from ._minimize import *
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\scipy\optimize\_minimize.py", line 33, in <module>
        from .tnc import _minimize_tnc
      File "C:\Users\pete.aniello\PycharmProjects\test1\venv5\lib\site-packages\scipy\optimize\tnc.py", line 37, in <module>
        from scipy.optimize import moduleTNC, approx_fprime
    ImportError: cannot import name moduleTNC
  • jdouglassjdouglass Administrator, NatCap Staff
    Hmm, this looks like there's an issue with one of the submodules from the scipy package.  I wonder if a recent package upgrade or downgrade in your virtual environment might have caused something to break.  In any case, could you try reinstalling scipy and see if that happens to fix the issue?

    Thanks!
    James
  • paniellopaniello Member
    Good call James...upgraded scipy from 1.0 to 1.1 and it works now.  Thanks!
This discussion has been closed.