mechmotum / cyipopt

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

FileNotFoundError: [WinError 2] The system cannot find the file specified #195

Closed yasirroni closed 1 year ago

yasirroni commented 1 year ago

Running py setup.py install returned with:

  File "setup.py", line 98, in pkgconfig
    output = sp.Popen(["pkg-config", "--libs", "--cflags"] + list(packages),
  File "C:\Users\muham\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\muham\AppData\Local\Programs\Python\Python38\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

Testing pkg-config:

pkg-config

Must specify at least one library at C:\Strawberry\perl\bin/pkg-config line 1237.

Do you what happen here? I can't use conda and need a windows solution. Thanks.

moorepants commented 1 year ago

We have some Windows installation instructions here https://cyipopt.readthedocs.io/en/stable/install.html#from-source-on-windows

yasirroni commented 1 year ago

I've following the tutorial. But, I'm not sure if I got Visual C++ or not. As far as I remember, I've been already successfully install cvxpy from source, thus it should be already installed.

The code structure also already following below instruction:

After Ipopt is extracted, the bin, lib and include folders should be in the root cyipopt directory, i.e. adjacent to the setup.py

moorepants commented 1 year ago

You'll have to show us here exactly what you are doing for us to help. Please provide the exact steps you perform so we can see what might be happening.

yasirroni commented 1 year ago
  1. Clone this repository
  2. Download Ipopt-3.13.3-win64-msvs2019-md.zip
  3. Extract Ipopt-3.13.3-win64-msvs2019-md.zip
  4. Copy all folder inside Ipopt-3.13.3-win64-msvs2019-md to this repository
  5. py setup.py install

I think this is due to old pkg-config version?

moorepants commented 1 year ago

You aren't setting the environment variable to point to the directory you extract. pkg-config is not used on windows (if you properly set the env var).

moorepants commented 1 year ago

There was a regression that would cause the files adjacent to the setup.py to not be found. It has been fixed in #220. Please reopen if this doesn't fix the issue for you.