--------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[1], line 5 3 import geopandas as gpd 4 from libpysal import weights ----> 5 from spreg import GM_Combo 6 import libpysal 7 from sklearn.preprocessing import StandardScaler ImportError: cannot import name 'GM_Combo' from 'spreg' (unknown location)
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 3 1 import pandas as pd 2 import geopandas as gpd ----> 3 from mgwr.gwr import GWR, MGWR 4 from mgwr.sel_bw import Sel_BW 5 from shapely.geometry import Point File ~\anaconda3\Lib\site-packages\mgwr\__init__.py:3 1 __version__ = "2.1.2" ----> 3 from . import gwr 4 from . import sel_bw 5 from . import diagnostics File ~\anaconda3\Lib\site-packages\mgwr\gwr.py:11 9 from scipy.special import factorial 10 from itertools import combinations as combo ---> 11 from spglm.family import Gaussian, Binomial, Poisson 12 from spglm.glm import GLM, GLMResults 13 from spglm.iwls import iwls, _compute_betas_gwr File ~\anaconda3\Lib\site-packages\spglm\__init__.py:3 1 __version__ = '1.0.8' ----> 3 from . import glm 4 from . import family 5 from . import utils File ~\anaconda3\Lib\site-packages\spglm\glm.py:7 5 import numpy as np 6 import numpy.linalg as la ----> 7 from spreg.utils import RegressionPropsY, spdot 8 from spreg import user_output as USER 9 from .utils import cache_readonly ModuleNotFoundError: No module named 'spreg.utils'
I can confirm that the installation is correct, and I can run the code when using version 1.2.4. I also checked the API file of spreg, but I can still see the module "GM_Combo".
I would appreciate it if you can reply to my message and figure these problems out. It would be of great help to my ongoing project.
Thank you and wish you a great day.
Best regards,
Wenrui DAI
08/10/2024
Hi Wenrui,
You may need to check that the version of spreg that you are accessing from within your jupyter environment is correct. Sometimes, when we install two different versions of a package in two different computational environments, one environment might not correctly identify the version of the package it needs to use.
Can you try putting the two lines at the top of your script, and tell me the output?
import spreg
print(spreg.__version__)
ljw
--
You received this message because you are subscribed to the Google Groups "Openspace List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
openspace-lis...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/openspace-list/PH0PR11MB49980A5EE8E5CFD3F7AD5F09CDBA2%40PH0PR11MB4998.namprd11.prod.outlook.com.
--