gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
377 stars 273 forks source link

ImportError: cannot import name 'SettingWithCopyWarning' from 'pandas.core.common' #8692

Closed emabcede30 closed 1 year ago

emabcede30 commented 1 year ago

Hi all,

I cannot start openquake3.16.2 oq webui start

here is the error message

Traceback (most recent call last): File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\PC\Desktop\project\oqVENV_3_16\Scripts\oq.exe__main.py", line 7, in File "C:\Users\PC\Desktop\project\oqVENV_3_16\lib\site-packages\openquake\commands\main.py", line 53, in oq sap.run(commands, prog='oq') File "C:\Users\PC\Desktop\project\oqVENV_3_16\lib\site-packages\openquake\baselib\sap.py", line 212, in run return _run(parser(funcdict, **parserkw), argv) File "C:\Users\PC\Desktop\project\oqVENV_3_16\lib\site-packages\openquake\baselib\sap.py", line 182, in parser funcdict = pkg2dic(funcdict) File "C:\Users\PC\Desktop\project\oqVENV_3_16\lib\site-packages\openquake\baselib\sap.py", line 161, in pkg2dic mod = importlib.import_module(dotname[:-3]) File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\importlib\init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Users\PC\Desktop\project\oqVENV_3_16\lib\site-packages\openquake\commands\run.py", line 25, in from pandas.core.common import SettingWithCopyWarning ImportError: cannot import name 'SettingWithCopyWarning' from 'pandas.core.common' (C:\Users\PC\Desktop\project\oqVENV_3_16\lib\site-packages\pandas\core\common.py)

I am unfamiliar how to fix SettingWithCopyWarning from pandas. Do I need to use pandas==1.5.x? Thanks in advance

Here are my other installed packages on my windows10 pc python3.10.11 virtual environment

Package Version


asgiref 3.6.0 certifi 2022.12.7 charset-normalizer 3.1.0 contourpy 1.0.7 cycler 0.11.0 decorator 5.1.1 Django 4.2 docutils 0.19 fonttools 4.39.3 h5py 3.8.0 idna 3.4 kiwisolver 1.4.4 matplotlib 3.7.1 numpy 1.24.3 openquake.engine 3.16.2 packaging 23.1 pandas 2.0.1 Pillow 9.5.0 pip 23.0.1 psutil 5.9.5 pyparsing 3.0.9 pyproj 3.5.0 python-dateutil 2.8.2 pytz 2023.3 pyzmq 25.0.2 requests 2.29.0 scipy 1.10.1 setuptools 65.5.0 shapely 2.0.1 six 1.16.0 sqlparse 0.4.4 toml 0.10.2 tzdata 2023.3 urllib3 1.26.15

micheles commented 1 year ago

We provide the universal installer for people that need a development environment. Remove your venv and follow the instructions given in https://github.com/gem/oq-engine/blob/master/doc/installing/universal.md. Then you will get the right versions of the libraries to use,i.e. https://github.com/gem/oq-engine/blob/master/requirements-py310-win64.txt