spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.22k stars 1.59k forks source link

Error occurred while starting kernel #22281

Open windprince opened 1 month ago

windprince commented 1 month ago

Description

What steps will reproduce the problem?

I just started spyder for the very first time and it generated this error:

ImportError: A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.1 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2.

Traceback


A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\plugins\application\container.py", line 492, in _compute_dependencies
    dependencies.declare_dependencies()
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 458, in declare_dependencies
    add(dep['modname'], dep['package_name'],
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 389, in add
    DEPENDENCIES += [Dependency(modname, package_name, features,
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 331, in __init__
    self.installed_version = programs.get_module_version(modname)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\utils\programs.py", line 839, in get_module_version
    mod = __import__(module_name)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\__init__.py", line 161, in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\colors.py", line 57, in <module>
    from matplotlib import _api, _cm, cbook, scale
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\scale.py", line 22, in <module>
    from matplotlib.ticker import (
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\ticker.py", line 143, in <module>
    from matplotlib import transforms as mtransforms
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\transforms.py", line 49, in <module>
    from matplotlib._path import (
Traceback (most recent call last):
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\numpy\core\_multiarray_umath.py", line 44, in __getattr__
    raise ImportError(msg)
ImportError: 
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\plugins\application\container.py", line 492, in _compute_dependencies
    dependencies.declare_dependencies()
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 458, in declare_dependencies
    add(dep['modname'], dep['package_name'],
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 389, in add
    DEPENDENCIES += [Dependency(modname, package_name, features,
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 331, in __init__
    self.installed_version = programs.get_module_version(modname)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\utils\programs.py", line 839, in get_module_version
    mod = __import__(module_name)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\pandas\__init__.py", line 49, in <module>
    from pandas.core.api import (
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\pandas\core\api.py", line 1, in <module>
    from pandas._libs import (
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\pandas\_libs\__init__.py", line 17, in <module>
    import pandas._libs.pandas_datetime  # noqa: F401 # isort: skip # type: ignore[reportUnusedImport]
Traceback (most recent call last):
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\numpy\core\_multiarray_umath.py", line 44, in __getattr__
    raise ImportError(msg)
ImportError: 
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "C:\Users\windp\anaconda3\envs\pyspark\Scripts\spyder-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\app\start.py", line 256, in main
    mainwindow.main(options, args)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\app\mainwindow.py", line 1847, in main
    mainwindow = create_window(MainWindow, app, splash, options, args)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\app\utils.py", line 333, in create_window
    app.exec_()
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\widgets\reporterror.py", line 398, in _submit_to_github
    issue_text = self.render_issue(
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\widgets\reporterror.py", line 323, in render_issue
    {dependencies.status()}
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 417, in status
    data.append([dep_order[dep.kind], title, dep.get_installed_version()])
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 360, in get_installed_version
    if self.check():
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 349, in check
    installed = programs.is_module_installed(
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\utils\programs.py", line 907, in is_module_installed
    module_version = get_module_version(module_name)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\utils\programs.py", line 839, in get_module_version
    mod = __import__(module_name)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\__init__.py", line 161, in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\colors.py", line 57, in <module>
    from matplotlib import _api, _cm, cbook, scale
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\scale.py", line 22, in <module>
    from matplotlib.ticker import (
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\ticker.py", line 143, in <module>
    from matplotlib import transforms as mtransforms
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\matplotlib\transforms.py", line 49, in <module>
    from matplotlib._path import (
Traceback (most recent call last):
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\numpy\core\_multiarray_umath.py", line 44, in __getattr__
    raise ImportError(msg)
ImportError: 
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "C:\Users\windp\anaconda3\envs\pyspark\Scripts\spyder-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\app\start.py", line 256, in main
    mainwindow.main(options, args)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\app\mainwindow.py", line 1847, in main
    mainwindow = create_window(MainWindow, app, splash, options, args)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\app\utils.py", line 333, in create_window
    app.exec_()
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\widgets\reporterror.py", line 398, in _submit_to_github
    issue_text = self.render_issue(
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\widgets\reporterror.py", line 323, in render_issue
    {dependencies.status()}
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 417, in status
    data.append([dep_order[dep.kind], title, dep.get_installed_version()])
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 360, in get_installed_version
    if self.check():
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\dependencies.py", line 349, in check
    installed = programs.is_module_installed(
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\utils\programs.py", line 907, in is_module_installed
    module_version = get_module_version(module_name)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\spyder\utils\programs.py", line 839, in get_module_version
    mod = __import__(module_name)
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\pandas\__init__.py", line 49, in <module>
    from pandas.core.api import (
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\pandas\core\api.py", line 1, in <module>
    from pandas._libs import (
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\pandas\_libs\__init__.py", line 17, in <module>
    import pandas._libs.pandas_datetime  # noqa: F401 # isort: skip # type: ignore[reportUnusedImport]
Traceback (most recent call last):
  File "C:\Users\windp\anaconda3\envs\pyspark\Lib\site-packages\numpy\core\_multiarray_umath.py", line 44, in __getattr__
    raise ImportError(msg)
ImportError: 
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Versions

Dependencies

# Mandatory:
atomicwrites >=1.2.0             :  1.4.0 (OK)
chardet >=2.0.0                  :  4.0.0 (OK)
cloudpickle >=0.5.0              :  2.2.1 (OK)
cookiecutter >=1.6.0             :  2.6.0 (OK)
diff_match_patch >=20181111      :  20200713 (OK)
intervaltree >=3.0.2             :  3.1.0 (OK)
IPython >=8.13.0,<9.0.0,!=8.17.1 :  8.25.0 (OK)
jedi >=0.17.2,<0.20.0            :  0.19.1 (OK)
jellyfish >=0.7                  :  1.0.1 (OK)
jsonschema >=3.2.0               :  4.19.2 (OK)
keyring >=17.0.0                 :  24.3.1 (OK)
nbconvert >=4.0                  :  7.10.0 (OK)
numpydoc >=0.6.0                 :  1.7.0 (OK)
paramiko >=2.4.0                 :  2.8.1 (OK)
parso >=0.7.0,<0.9.0             :  0.8.3 (OK)
pexpect >=4.4.0                  :  4.8.0 (OK)
pickleshare >=0.4                :  0.7.5 (OK)
psutil >=5.3                     :  5.9.0 (OK)
pygments >=2.0                   :  2.15.1 (OK)
pylint >=2.5.0,<3.1              :  2.16.2 (OK)
pylint_venv >=3.0.2              :  3.0.3 (OK)
pyls_spyder >=0.4.0              :  0.4.0 (OK)
pylsp >=1.10.0,<1.11.0           :  1.10.0 (OK)
pylsp_black >=2.0.0,<3.0.0       :  2.0.0 (OK)
qdarkstyle >=3.2.0,<3.3.0        :  3.2.3 (OK)
qstylizer >=0.2.2                :  0.2.2 (OK)
qtawesome >=1.2.1                :  1.2.2 (OK)
qtconsole >=5.5.1,<5.6.0         :  5.5.1 (OK)
qtpy >=2.1.0                     :  2.4.1 (OK)
rtree >=0.9.7                    :  1.0.1 (OK)
setuptools >=49.6.0              :  69.5.1 (OK)
sphinx >=0.6.6                   :  7.3.7 (OK)
spyder_kernels >=2.5.0,<2.6.0    :  2.5.0 (OK)
textdistance >=4.2.0             :  4.2.1 (OK)
three_merge >=0.1.1              :  0.1.1 (OK)
watchdog >=0.10.3                :  4.0.1 (OK)
zmq >=22.1.0                     :  25.1.2 (OK)

# Optional:
cython >=0.21                    :  None (NOK)
matplotlib >=3.0.0               :  None (NOK)
numpy >=1.7                      :  2.0.1 (OK)
pandas >=1.1.1                   :  None (NOK)
scipy >=0.17.0                   :  1.13.1 (OK)
sympy >=0.7.3                    :  1.12 (OK)
dalthviz commented 1 month ago

Hi @windprince thank you for the feedback! Seems like you are running under a conda environment with the name pyspark? Maybe over that env you have installed matplotlib and pandas versions incompatible with numpy 2.x? Could it be possible for you to share the conda list output of the conda env you are using and try over the Python interpreter with your env activated to import matplotlib or pandas to see if any error is generated? Let us know!

dani-lbnl commented 1 month ago

I have the same problem with google colab with installs with pip, so it is not a conda problem