mechmotum / cyipopt

Cython interface for the interior point optimzer IPOPT
Eclipse Public License 2.0
227 stars 54 forks source link

pip install does not work #217

Closed aaronjohnsabu1999 closed 11 months ago

aaronjohnsabu1999 commented 1 year ago

pip install ipopt doesn't work for my Windows 11 system when run on Git Bash.

Here's the output:

Collecting ipopt
  Downloading ipopt-1.0.3.tar.gz (42 kB)
     ---------------------------------------- 42.4/42.4 kB 85.8 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\aaronjs\AppData\Local\Temp\pip-install-wu42q89k\ipopt_f7ccb407f23a4a4e9c0b6729c77974c0\setup.py", line 194, in <module>
          ext_module_data = handle_ext_modules_general_os()
        File "C:\Users\aaronjs\AppData\Local\Temp\pip-install-wu42q89k\ipopt_f7ccb407f23a4a4e9c0b6729c77974c0\setup.py", line 173, in handle_ext_modules_general_os
          **pkgconfig("ipopt"))
        File "C:\Users\aaronjs\AppData\Local\Temp\pip-install-wu42q89k\ipopt_f7ccb407f23a4a4e9c0b6729c77974c0\setup.py", line 100, in pkgconfig
          output = sp.Popen(["pkg-config", "--libs", "--cflags"] + list(packages),
        File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 858, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1311, in _execute_child
          hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
      FileNotFoundError: [WinError 2] The system cannot find the file specified
      [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.
moorepants commented 1 year ago

These are the current installation instructions for windows: https://cyipopt.readthedocs.io/en/stable/install.html#from-source-on-windows

Did you follow those instructions?

aaronjohnsabu1999 commented 1 year ago

@moorepants Yes, I did. It still shows the same error.

$ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 192, in <module>
    ext_module_data = handle_ext_modules_general_os()
  File "setup.py", line 171, in handle_ext_modules_general_os
    **pkgconfig("ipopt"))
  File "setup.py", line 98, in pkgconfig
    output = sp.Popen(["pkg-config", "--libs", "--cflags"] + list(packages),
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1311, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
moorepants commented 1 year ago

The error shows that it doesn't know you are on Windows, so It isn't clear that you have set the correct environment variables so it can find Ipopt on windows. Did you follow that part of the instructions?

moorepants commented 11 months ago

Seems to be the same issue as https://github.com/mechmotum/cyipopt/issues/195.

moorepants commented 11 months ago

Not enough information is provided to debug this. Maybe it was the same issue as #195. Please reopen if that fix doesn't address the issue.

moorepants commented 11 months ago

Also worth noting that you seem to be downloading an old version of cyipopt:

Collecting ipopt
  Downloading ipopt-1.0.3.tar.gz (42 kB)