AttributeError: 'SolverStatus' object has no attribute 'key' - pyomo

i got this error message when running an energy system optimization problem. Please any tips on how to resolve this?
Blockquote
"Traceback (most recent call last):
File "C:\Users\aadetunj\Desktop\oemof-examples-master\OSeEM-SN-main\scripting\scenarios\OSeEM-SN.py", line 318, in
m.solve("cbc")
File "C:\Users\aadetunj\Anaconda3\envs\virtualenv\lib\site-packages\oemof\solph\models.py", line 204, in solve
status = solver_results["Solver"][0]["Status"].key
AttributeError: 'SolverStatus' object has no attribute 'key'
Blockquote

Related

NEOS solver bonmin

did anyone know why this error happen? other solver such as cbc works fine but when sent to NEOS, I got the following error in command line
Traceback (most recent call last):
File "C:\repos\work_packager\Test\Scratch\Networkx_Sample\testss.py", line 409, in
process_data(df, df)
File "C:\repos\work_packager\Test\Scratch\Networkx_Sample\testss.py", line 191, in process_data
pyomo_tool(df,road_year, pit_year, road_estimated_cost, pit_estimated_cost, road_tot_budget, pit_tot_budget,
File "C:\repos\work_packager\Test\Scratch\Networkx_Sample\testss.py", line 291, in pyomo_tool
solver.solve(model)
File "C:\Python31\lib\site-packages\pyomo\opt\results\container.py", line 284, in getattr
raise AttributeError("Unknown attribute "+str(name)+"' for object with type "+str(type(self))) AttributeError: Unknown attribute solve' for object with type <class 'pyomo.opt.results.results_.SolverResults'>

Error when i try to OpenRAM, AttributeErrir: 'NoneType' object has no attribute 'startswith'

I get the error. how should i fix it?
ERROR: runTest (30_openram_test.openram_test)
Traceback (most recent call last): File "/home/leepil/OpenRAM-master/compiler/tests/30_openram_test.py", line 23, in runTest
globals.init_openram("config_20_{0}".format(OPTS.tech_name))
enter code here
File "/home/leepil/OpenRAM-master/compiler/tests/../globals.py", line 113, in init_openram
import_tech()
File "/home/leepil/OpenRAM-master/compiler/tests/../globals.py", line 314, in import_tech
__import__(filename)
File "/home/leepil/OpenRAM-master/technology/setup_scripts/setup_openram_freepdk45.py", line 16, in <module>
PDK_DIR=os.path.abspath(os.environ.get("FREEPDK45"))
File "/home/leepil/PycellStudio3/plat_linux_gcc44x_64/3rd/lib/python2.7/posixpath.py", line 367, in abspath
if not isabs(path):
File "/home/leepil/PycellStudio3/plat_linux_gcc44x_64/3rd/lib/python2.7/posixpath.py", line 61, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
For info, I am on OpenRAM-Master (Tech is freepdk45) & Python version 2.7.9.
See the detail error message below. Thx!

Python. AttributeError: 'NoneType' object has no attribute 'startswith'

Why is it this code won't work and give AttributeError?
internship = parser.find_all('a', attrs = {'title': lambda job: job.startswith('Internship')})
while this one works:
internship = parser.find_all('a', attrs = {'title': lambda job: job and job.startswith('Internship')})
This is the error that I got from the first code:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\bs4\element.py", line 1299, in find_all
return self._find_all(name, attrs, text, limit, generator, **kwargs)
File "C:\Python27\lib\site-packages\bs4\element.py", line 549, in _find_all
found = strainer.search(i)
File "C:\Python27\lib\site-packages\bs4\element.py", line 1690, in search
found = self.search_tag(markup)
File "C:\Python27\lib\site-packages\bs4\element.py", line 1662, in search_tag
if not self._matches(attr_value, match_against):
File "C:\Python27\lib\site-packages\bs4\element.py", line 1722, in _matches
return match_against(markup)
File "<stdin>", line 1, in <lambda>
AttributeError: 'NoneType' object has no attribute 'startswith'
In the first line of code, you are getting the attribute error because the code assumes that job contains a string, which has the method startswith(), but it doesn't contain a string, it contains None.
In the second line of code, you are not getting the attribute error because the code is testing to see if job contains None, before calling startswith() on it. Another (not quite equivalent but arguably better) way to express
lambda job: job and job.startswith('Internship')
is
lambda job: job.startswith('Internship') if job else False

subprocess AttributeError: 'module' object has no attribute 'check_ouput' aix

Not sure why im getting this error as subprocess check_output is in python 2.7 which im running?
ctmtest1-tctmsv80 [10] python del_jobs_main.py
sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0)
Traceback (most recent call last):
File "del_jobs_main.py", line 51, in <module>
sys.exit(main())
File "del_jobs_main.py", line 42, in main
p_call = do_sh_shell_command('env | grep machine')
File "del_jobs_main.py", line 33, in do_sh_shell_command
p = subprocess.check_ouput(string_command, shell=True, stdin=subprocess.PIPE,
AttributeError: 'module' object has no attribute 'check_ouput'
any help on this weird error would be greatly appreciated

Use Apportable to port ios app to android app: AttributeError: 'NoneType' object has no attribute 'startswith'

I stuck in this error
AttributeError: 'NoneType' object has no attribute 'startswith'
when try "apportable load"
Who can help me?
Here is detail log in terminal:
raceback (most recent call last):
File "/Users/ducnm/.apportable/SDK/bin/apportable", line 845, in <module>
run(env)
File "/Users/ducnm/.apportable/SDK/bin/apportable", line 781, in run
results = actions[args.action](env)
File "/Users/ducnm/.apportable/SDK/bin/apportable", line 86, in LoadAction
return env.LoadApp(site_init.BuildApplication(env, env['BUILD_TARGET']))
File "/Users/ducnm/.apportable/SDK/site_scons/site_init.py", line 390, in BuildApplication
return build.App(env, app_sconscript)
File "/Users/ducnm/.apportable/SDK/site_scons/build/__init__.py", line 556, in App
results = env.BuildApp(sources=sources, header_paths=headers, defines=defines, flags=flags, config=configs, deps=deps, libs=libs, java_libs=java_libs, assets=assets, pch=pchs, modules=modules, java_sources=java_sources, java_sourcepaths=java_sourcepaths, java_res_dirs=java_res_dirs)
File "/Users/ducnm/.apportable/SDK/lib/scons/engine/SCons/Environment.py", line 223, in __call__
return self.method(*nargs, **kwargs)
File "/Users/ducnm/.apportable/SDK/site_scons/site_init.py", line 1204, in BuildApp
build.Module(env, module["build_cwd"], module)
File "/Users/ducnm/.apportable/SDK/site_scons/build/__init__.py", line 577, in Module
target_file_name_base = os.path.abspath(os.path.join(target["project"] + ".approj", "targets", target["target"], target["project_config"]))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 66, in join
if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'
AttributeError: 'NoneType' object usually indicates a missing symbol to the linker. Look higher up in the log for missing symbols.
Background: apportable load does a parallel build which leads to more logging after the fatal error. The parallel build can be disabled with the option -j1.