About python pip installation (pip install pyswmm) error

C:\WINDOWS\system32>pip install PySWMM
Collecting PySWMM
Using cached pyswmm-1.2.0-py3-none-any.whl (101 kB)
Collecting swmm-toolkit>=0.9.0
Using cached swmm-toolkit-0.9.0.zip (640 kB)
Preparing metadata (setup.py) … error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “C:\Users\BiHa\AppData\Local\Temp\pip-install-1trx6gdi\swmm-toolkit_4953af2bc00347d3832818f038d02478\setup.py”, line 20, in
from skbuild import setup
ModuleNotFoundError: No module named ‘skbuild’
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Looks like a missing dependency (skbuild is familiar, comes from scikit-build package). Best to contact the project in question, they’d probably know best - probably it’s a problem of something in the chain not supporting the Python version you’re using.

1 Like

Thanks bro
How do I get the scikit-build package

Hi, I have the same problem. What could we do?

I’m trying to get PIP to run.

I’ve attempted installation/uninstallation of 3.10 and 3.11 on my Win 11 laptop. In all cases, I click on the automatic choice (top). Supposedly this includes PIP. In all cases, PIP doesn’t get installed. When I type in PIP, I get the following

Python 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘pip’ is not defined. Did you mean: ‘zip’?

Does anyone have any ideas on how I can fix this?

See my comment in another thread earlier today:

You don’t run pip from inside the Python environment. You need to run it from the Windows command prompt.

Because you have two versions of Python on your system, it is important that you use the py -m pip ... version of the command, otherwise you may get confusion over which Python gets the packages installed.

I’m not sure how it works on Windows, but if pip still doesn’t work, you may need to run py -m ensurepip first to set it up. The documentation says you won’t need to run it, but who knows?

  1. Make sure you are running from cmd.com and not the Python interpreter, if you see the >>> prompt you are in Python.
  2. Try using py -m pip install PackageName (for whatever package you are trying to install).
  3. If and only if that reports an error “No module named pip” should you then try py -m ensurepip.

Good luck!