我是pyomo
的新手,曾经尝试install-extras
。我收到以下错误:
C:\Users\ip12\AppData\Local>pyomo install-extras
Traceback (most recent call last):
File "c:\users\ip12\appdata\local\programs\python\python37-32\lib\site-packages\pyutilib\subprocess\processmngr.py", line 631, in run_command
shell=shell)
File "c:\users\ip12\appdata\local\programs\python\python37-32\lib\site-packages\pyutilib\subprocess\processmngr.py", line 776, in __init__
shell=shell)
File "c:\users\ip12\appdata\local\programs\python\python37-32\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "c:\users\ip12\appdata\local\programs\python\python37-32\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
在处理上述异常期间,发生了另一个异常:
Traceback (most recent call last):
File "c:\users\ip12\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\ip12\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\ip12\AppData\Local\Programs\Python\Python37-32\Scripts\pyomo.exe\__main__.py", line 9, in <module>
File "c:\users\ip12\appdata\local\programs\python\python37-32\lib\site-packages\pyomo\scripting\pyomo_main.py", line 82, in main
retval = _options.func(_options)
File "c:\users\ip12\appdata\local\programs\python\python37-32\lib\site-packages\pyomo\scripting\driver_help.py", line 46, in install_extras_exec
pyutilib.subprocess.run(command, tee=True)
File "c:\users\ip12\appdata\local\programs\python\python37-32\lib\site-packages\pyutilib\subprocess\processmngr.py", line 660, in run_command
(' '.join(_cmd), err))
pyutilib.common._exceptions.ApplicationError: Could not execute the command: 'c:\users\ip12\appdata\local\programs\python\python37-32\get_pyomo_extras'
Error message: [WinError 2] The system cannot find the file specified
答案 0 :(得分:0)
如果使用的是Anaconda,则应打开conda终端(“环境”>“基础(根)”>“打开终端”),然后在shell中执行该操作:
conda install -c conda-forge pyomo.extras