CPLEX Python API installment on Mac big sur(M1) CpoException problem - optimization

I just install Cplex on my mac(m1). When I run any example code, it shows this error.
File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site- packages/docplex/cp/solver/solver_local.py", line 120, in init
raise CpoException("Executable file '{}' does not exists".format(xfile))
CpoException: Executable file 'cpoptimizer' does not exists.
What's the main issue here?

Issue Solved:
Just change this line
msol = mdl.solve(TimeLimit=10) to
msol = mdl.solve(TimeLimit=10, execfile='/Applications/CPLEX_Studio221/cpoptimizer/bin/x86-64_osx/cpoptimizer')

Related

"No single root directory found, all dists must extract to a single directory" error when trying to upload module to zef via App::Mi6

Getting a weird error I've never seen before while trying to upload a new module to zef using the App::Mi6 mi6 release command:
==> Step 9. UploadToZef
Are you sure you want to upload Directory-0.0.1.tar.gz to Zef ecosystem? (y/N) y
Executing /Users/steve/.rakubrew/versions/moar-2022.12/bin/rakudo -e use Fez::CLI --file=Directory-0.0.1.tar.gz upload
>>= Looking in "Directory-0.0.1.tar.gz" for META6.json
=<< No single root directory found, all dists must extract to a single directory
Failed
in method upload at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/sources/12D2D4FC78FDF40E8B7DEC72AF31ECED31A67D08 (App::Mi6::Fez) line 19
in method run at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/sources/A4949DB54562D3B5154DD447B5CC2C730F09B0E5 (App::Mi6::Release::UploadToZef) line 24
in method run at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/sources/BDF7095037EE976677901A8557FD533DCDC6FD65 (App::Mi6::Release) line 49
in method cmd at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/sources/299DED9746B9228495A0B5E829FE0A6BBD7DFE88 (App::Mi6) line 162
in sub MAIN at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/resources/5831540356728593B89C55370F0C33F8DD0813F5 line 20
in block <unit> at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/resources/5831540356728593B89C55370F0C33F8DD0813F5 line 5
in sub MAIN at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/bin/mi6 line 3
in block <unit> at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/bin/mi6 line 1
Google turns up nothing on this error. This means I've found a major bug or the three glasses of wine I've had tonight have me doing something really stupid. :)
OK, this is a bug related to how the fez module interacts with how tarballs are generated on a mac.
A pull request has been made to address this issue: https://github.com/tony-o/raku-fez/pull/74.
I'm not sure what accounts for things working on 2022.07 and not 2022.12 version of raku.

Problems with GDAL, Libspatialite, Rasterio and Sumo (ImportError, Symbol _GEOSArea not found, Referencing from libspatialite.7.dylib)

I'm new to using gdal/libspatialite/rasterio/sumo and all the family of library and packages that is related to geographical, time and space. But I was just wondering what's this error here? Does anyone have experience with this error before? Have you seen it before? And if so have you been able to resolve it? And if so, what were the things you did to resolve it. I'm stuck with this for almost days now and idk what else to do. I'm running this on Python 3.9.6 on a MacOS Big Sur. I'm confused whether the problem is either one of these packages (or a combination of).
It's really annoying how it doesn't work here but works perfectly fine in my old computer that runs in MacOS Catalina with Python 3.9.0. Thank you in advance for your time.
File "/opt/homebrew/lib/python3.9/site-packages/contextily/__init__.py", line 7, in <module>
from .place import Place, plot_map
File "/opt/homebrew/lib/python3.9/site-packages/contextily/place.py", line 7, in <module>
from .tile import howmany, bounds2raster, bounds2img, _sm2ll, _calculate_zoom
File "/opt/homebrew/lib/python3.9/site-packages/contextily/tile.py", line 16, in <module>
import rasterio as rio
File "/opt/homebrew/lib/python3.9/site-packages/rasterio/__init__.py", line 9, in <module>
from rasterio._base import gdal_version
ImportError: dlopen(/opt/homebrew/lib/python3.9/site-packages/rasterio/_base.cpython-39-darwin.so, 2): Symbol not found: _GEOSArea
Referenced from: /opt/homebrew/opt/libspatialite/lib/libspatialite.7.dylib
Expected in: flat namespace

Errno 22 invalid mode('U') or filename

I'm facing error
[Errno 22] invalid mode('U') or filename:' ' while creating exe file
using cx_
Freeze in Python. my code includes some vbs file which are actually require to interact with Windows features. Those .vbs files are located in same location.
I'm new to this Python. Maybe some silly mistake
Please any help will be really appreciable.
Below is the part of the code. All imports are taken care already.
if s1 == "xx" or s1 == "yy":
os.system("response.vbs")
else:
os.system("no.vbs")
Sorry cannot post the overall code.
Well Problem get solved.
This was first time I was using cx_freez. If we don't mention the fields under setup this error occurs.
setup( name = "THIS CANNOT BE BLANK", version = "0.1", description = "trigger", executables = [Executable("THIS CANNOT BE BLANK")], )
Thank you Tinfoilboy for your responses.
Silly me :(

Tensorboard __init__() got an unexpected keyword argument 'purge_orphaned_data'

Running tensorboard for first time in a new VM and I end up with this error at tensorboard init(). Thanks for the help.
Traceback (most recent call last):
File "/home/sarath/virtualenvs/tensorflow/bin/tensorboard", line 9, in module> load_entry_point('tensorflow==0.7.1', 'console_scripts', 'tensorboard')()
File "/home/sarath/virtualenvs/tensorflow/local/lib/python2.7/site-packages/tensorflow/tensorboard/tensorboard.py", line 82, in main
purge_orphaned_data=FLAGS.purge_orphaned_data)
TypeError: __ init__() got an unexpected keyword argument 'purge_orphaned_data'
TensorBoard developer here. I'm quite confused how this happened, because while the purge_orphaned_data flag exists in master, it doesn't exist in r0.7.1. Actually, the file path tensorflow/tensorboard/tensorboard.py doesn't exist in 0.7.1 (it is in tensorboard/backend/tensorboard.py in 0.7.1).
So it looks like somehow you got an installation that mixes r0.7.1 but also files from master. Could you please file a Github issue on TensorFlow with a repro on how you got into this state?
I have the same problem. I deleted "purge_orphaned_data=FLAGS.purge_orphaned_data" and it worked.

What does "system requires 8-byte headers" means

I saw this www.spec.org/cpu2006/Docs/481.wrf.html where it says that
If your system requires 8-byte headers, please set wrf_data_header_size = 8
Would you please tell me how to know that. Thanks in advance.
More info: I am trying to use spec2006 wrf program, which is 2.1 version of the program. I am not able to run that program, although it compiles with runspec.
Error is
At line 6744 of file module_ra_rrtm.fppized.f90 (unit = 10, file = 'RRTM_DATA')
Fortran runtime error: End of file
*** Miscompare of rsl.out.0000, see /path/rsl.out.0000.mis
'rsl.out.0000' short
Error: 1x481.wrf
I will be very grateful for any help.
You simply need to add wrf_data_header_size = 8 in the SPEC CPU configuration file you're using to build/run the WRF benchmarks.
See the config/Example-linux64-amd64-gcc41.cfg example configuration file that comes with SPEC CPU2006.