{"id":244,"hash":"92804480af6973df5407a08324653baa0876439823e15013ec16890c7861b85a","pattern":"AttributeError: module &#39;pkgutil&#39; has no attribute &#39;ImpImporter&#39;. Did you mean: &#39;zipimporter&#39;?","full_message":"Earlier I installed some packages like Matplotlib, NumPy, pip (version 23.3.1), wheel (version 0.41.2), etc., and did some programming with those. I used the command C:\\Users\\UserName>pip list to find the list of packages that I have installed, and I am using Python 3.12.0 (by employing code C:\\Users\\UserName>py -V).\n\nI need to use pyspedas to analyse some data. I am following the instruction that that I received from site to install the package, with a variation (I am not sure whether it matters or not: I am using py, instead of python). The commands that I use, in the order, are:\n\npy -m venv pyspedas\n.\\pyspedas\\Scripts\\activate\npip install pyspedas\n\nAfter the last step, I am getting the following output:\n\nCollecting pyspedas\n  Using cached pyspedas-1.4.47-py3-none-any.whl.metadata (14 kB)\nCollecting numpy>=1.19.5 (from pyspedas)\n  Using cached numpy-1.26.1-cp312-cp312-win_amd64.whl.metadata (61 kB)\nCollecting requests (from pyspedas)\n  Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)\nCollecting geopack>=1.0.10 (from pyspedas)\n  Using cached geopack-1.0.10-py3-none-any.whl (114 kB)\nCollecting cdflib<1.0.0 (from pyspedas)\n  Using cached cdflib-0.4.9-py3-none-any.whl (72 kB)\nCollecting cdasws>=1.7.24 (from pyspedas)\n  Using cached cdasws-1.7.43.tar.gz (21 kB)\n  Installing build dependencies ... done\n  Getting requirements to build wheel ... done\n  Preparing metadata (pyproject.toml) ... done\nCollecting netCDF4>=1.6.2 (from pyspedas)\n  Using cached netCDF4-1.6.5-cp312-cp312-win_amd64.whl.metadata (1.8 kB)\nCollecting pywavelets (from pyspedas)\n  Using cached PyWavelets-1.4.1.tar.gz (4.6 MB)\n  Installing build dependencies ... done\n  Getting requirements to build wheel ... error\n  error: subprocess-exited-with-error\n\n  × Getting requirements to build wheel did not run successfully.\n  │ exit code: 1\n  ╰─> [33 lines of output]\n      Traceback (most recent call last):\n        File \"C:\\Users\\UserName\\pyspedas\\Lib\\site-packages\\pip\\_vendor\\pyproject_hooks\\_in_process\\_in_process.py\", line 353, in <module>\n          main()\n        File \"C:\\Users\\UserName\\pyspedas\\Lib\\site-packages\\pip\\_vendor\\pyproject_hooks\\_in_process\\_in_process.py\", line 335, in main\n          json_out['return_val'] = hook(**hook_input['kwargs'])\n                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        File \"C:\\Users\\UserName\\pyspedas\\Lib\\site-packages\\pip\\_vendor\\pyproject_hooks\\_in_process\\_in_process.py\", line 112, in get_requires_for_build_wheel\n          backend = _build_backend()\n                    ^^^^^^^^^^^^^^^^\n        File \"C:\\Users\\UserName\\pyspedas\\Lib\\site-packages\\pip\\_vendor\\pyproject_hooks\\_in_process\\_in_process.py\", line 77, in _build_backend\n          obj = import_module(mod_path)\n                ^^^^^^^^^^^^^^^^^^^^^^^\n        File \"C:\\Users\\UserName\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\importlib\\__init__.py\", line 90, in import_module\n          return _bootstrap._gcd_import(name[level:], package, level)\n                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        File \"<frozen importlib._bootstrap>\", line 1381, in _gcd_import\n        File \"<frozen importlib._bootstrap>\", line 1354, in _find_and_load\n        File \"<frozen importlib._bootstrap>\", line 1304, in _find_and_load_unlocked\n        File \"<frozen importlib._bootstrap>\", line 488, in _call_with_frames_removed\n        File \"<frozen importlib._bootstrap>\", line 1381, in _gcd_import\n        File \"<frozen importlib._bootstrap>\", line 1354, in _find_and_load\n        File \"<frozen importlib._bootstrap>\", line 1325, in _find_and_load_unlocked\n        File \"<frozen importlib._bootstrap>\", line 929, in _load_unlocked\n        File \"<frozen importlib._bootstrap_external>\", line 994, in exec_module\n        File \"<frozen importlib._bootstrap>\", line 488, in _call_with_frames_removed\n        File \"C:\\Users\\UserName\\AppData\\Local\\Temp\\pip-build-env-_lgbq70y\\overlay\\Lib\\site-packages\\setuptools\\__init__.py\", line 16, in <module>\n          import setuptools.version\n        File \"C:\\Users\\UserName\\AppData\\Local\\Temp\\pip-build-env-_lgbq70y\\overlay\\Lib\\site-packages\\setuptools\\version.py\", line 1, in <module>\n          import pkg_resources\n        File \"C:\\Users\\UserName\\AppData\\Local\\Temp\\pip-build-env-_lgbq70y\\overlay\\Lib\\site-packages\\pkg_resources\\__init__.py\", line 2191, in <module>\n          register_finder(pkgutil.ImpImporter, find_on_path)\n                          ^^^^^^^^^^^^^^^^^^^\n      AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?\n      [end of output]\n\n  note: This error originates from a subprocess, and is likely not a problem with pip.\nerror: subprocess-exited-with-error\n\n× Getting requirements to build wheel did not run successfully.\n│ exit code: 1\n╰─> See above for output.\n\nnote: This error originates from a subprocess, and is likely not a problem with pip.\n\nAfter little bit of googling, I came to know that this issues was reported at multiple places, but none for this package. I did install wheel in the new environment as mentioned in the answer here, but the problem still persists.\n\nInstead of setting up a virtual environment, I simply executed the command py -m pip install pyspedas. But I am still getting the error.\n\nWhat I could gather is that the program has an issue with\n\nCollecting pywavelets (from pyspedas)\n  Using cached PyWavelets-1.4.1.tar.gz (4.6 MB)\n  Installing build dependencies ... done\n\nI am using IDLE in Windows 11.","ecosystem":"pypi","package_name":"python-3.x","package_version":null,"solution":"Due to the removal of the long-deprecated pkgutil.ImpImporter class, the pip command may not work for Python 3.12.\n\nYou just have to manually install pip for Python 3.12\n\npython -m ensurepip --upgrade\npython -m pip install --upgrade setuptools\npython -m pip install <module>\n\nIn your virtual environment:\n\npip install --upgrade setuptools\n\nPython comes with an ensurepip, which can install pip in a Python environment.\n\nhttps://pip.pypa.io/en/stable/installation/\n\nOn Linux/macOS terminal:\n\npython -m ensurepip --upgrade\n\nOn Windows:\n\npy -m ensurepip --upgrade\n\nalso, make sure to upgrade pip:\n\npy -m pip install --upgrade pip\n\nTo install numpy on Python 3.12, you must use numpy version 1.26.4\npip install numpy==1.26.4\n\nhttps://github.com/numpy/numpy/issues/23808#issuecomment-1722440746\n\nfor Ubuntu\n\nsudo apt install python3.12-dev\n\nor\n\npython3.12 -m pip install --upgrade setuptools","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/77364550/attributeerror-module-pkgutil-has-no-attribute-impimporter-did-you-mean","votes":252,"created_at":"2026-04-19T04:41:35.783844+00:00","updated_at":"2026-04-19T04:51:54.605919+00:00"}