Closed mlt39 closed 3 years ago
Thanks for posting the issue. The error is because the directory that contains the metawards executable has not been added to the windows system PATH. MetaWards uses pip as its installer. As part of installation, pip will install a script into the Python binary directory called metawards
. Looking at your path, I think you are running MetaWards from within a conda environment. Conda environments and pip don't always work together well, hence why it looks like the metawards
script has not been properly copied into the environment. You should find that the script is in the standard Python binary directory (the same one that pip is located in, that pytest and jupyter would be in, if you have installed those). Either make sure that this directory is in your system PATH, or copy the script to your my_env_name directory, or don't run metawards in a conda environment.
For R, you should get MetaWards working in Python first. I recommend installing a simple miniconda or anaconda into its own directory (e.g. C:\Users\my_username\MetaWards_Anaconda3) and installing MetaWards directly into that directory using pip and not using a conda environment. Verify that you can then run C:\Users\my_username\MetaWards_Anaconda3\metawards from the conda-bash (sorry if the path is wrong, I am a Linux/Mac user). Once you have the Python version working, you can then start R, and tell reticulate the path to the MetaWards_Anaconda3\python executable. This will then make sure that R is using a Python that can correctly find the metawards executable script.
Thanks very much for your reply.
I have tried installing metawards out of any conda environment, which has created metawards.exe files in C:\Users\my_username\Anaconda3\Scripts, which is where pip.exe etc live. I still get the error
──────────────────────────────────── ERROR ────────────────────────────────────
Cannot find the metawards executable:
C:\Users\my_username\Anaconda3\metawards
────────────────────────────────────────────────────────────
even after adding C:\Users\my_username\Anaconda3\Scripts into my system PATH
sys.path.append(os.path.join("C:\\", "Users", "my_username", "Anaconda3", "Scripts"))
I also tried copying metawards.exe (and the other exe files: metawards-jupyter, metawards-plot, metawards-python etc) into C:\Users\my_username\Anaconda3\metawards, however I get the same error.
Thanks - sometimes a "could not find" error for an executable is caused by the executable not being able to run. Are you able to run the metawards.exe executable from the command line (powershell)? Running metawards --version
should show version output.
Yes, I get output about MetaWards version 1.5.1.
Thanks - I can see the error in the code. It is a bug and is wrong here: https://github.com/metawards/MetaWards/blob/0e54560268049c97cd0458d234df1b492f2082bf/src/metawards/_run.py#L171
What I mistakenly did was to try to find the metawards executable by looking for a file called "metawards" in the same directory as the python executable (sys.executable
). This didn't exist on Windows, hence the Console.error
message that was triggered on the line below.
I think that this is because I should have added a check for metawards.exe
. I've just run a quick test locally and that is the issue.
I've just pushed a commit to the devel
branch that should fix this issue. Please could you try this fix to see if it resolves your problem. The easiest way to do this is to copy this file (https://github.com/metawards/MetaWards/blob/devel/src/metawards/_run.py) - this is MetaWards/src/metawards/_run.py
if you git cloned the repository - and copy it to replace the _run.py
that was installed by pip. I think this will be located in your Python's site-packages/metawards/_run.py
.
(alternatively, a development build is now underway via this GitHub Action. Once it has done you should see an Artifact called dist
at the bottom of the screen which you can download and unzip. This will contain pip packages for the devel version of metawards on Windows, Mac and Linux, for Python 3.7, 3.8 and 3.9. Just "pip install" the filename for the Windows 3.8 version. It should be ready in about 20 minutes. Don't worry about the failure in the Ubuntu 3.8 build - this is caused by the latest merge update of Sphinx, where Sphinx 4.0 crashes when parsing the MetaWards docs)
Thanks very much. That error seems to have been solved. Now I get the error
────────────────────────── INFO ──────────────────────
Writing output to directory .\output_j99bf1hr
────────────────────────────────────────────────────
────────────────────────── ERROR ─────────────────────
[ERROR] <class 'FileNotFoundError'>: [WinError 2] The system cannot find the file specified
────────────────────────────────────────────────────
────────────────────────── ERROR ─────────────────────
Something went wrong with the run. Please look at .\output_j99bf1hr/console.log.bz2 for more
information
────────────────────────────────────────────────────
which appears to be coming from lines 442-445 https://github.com/metawards/MetaWards/blob/f17949950da4ebe6ee76598576cd22dabd289952/src/metawards/_run.py#L442-L445. (And there is no file .\output_j99bf1hr/console.log.bz2 to look at.)
In that line,
args = ['C:Usersmy_usernameAnaconda3metawards.exe', '--force-overwrite-output', '--output', '.output_bbhvyudg', '--disease', 'C:Usersmy_usernameDocumentsmy_projectinput_e8bcmjnydisease.json', '--model', 'C:Usersmy_usernameDocumentsmy_projectinput_e8bcmjnymodel.json.bz2', '--theme', 'simple', '--no-spinner', '--no-progress']
Thanks - from the args is looks like the code hasn't properly added the directory separators - they've been eaten somehow. I am going to build a unit test now that can let me fix the bug and check that this all runs on the Windows actions. I'll let you know when it is all working :-)
Issue is shlex.split
doesn't work on windows - see here. I am looking at the solutions there and coding a workaround...
Thanks very much!
No problem. Just to say that I am nearly there now. The metawards executable is found and run in the GitHub Action, but there is something strange with the return value that is causing the handler code to think that the simulation errored. I've had to rebuild a Windows environment on an old machine so that I can continue to debug (it is almost ready - I have to do this because my current machine is a M1 ARM Mac, and while I can access Windows ARM, I haven't yet finished getting metawards Windows ARM working yet. Hence I'm getting my old X86 Mac running Windows X86 again... Lots of updates... ;-))
Ok - I think this is now fixed. It works for me locally, plus the unit test passes on GitHub Actions on the Windows runners. Please update to the latest devel version (e.g. via the dist file that will pop up once all of the actions have finished) and then let me know if it works for you :-)
I've made some more changes as there were issues running metawards from within R via reticulate (the executable couldn't connect to stdout). I have also updated the website documentation with better installation instructions for windows. You should find everything here: https://metawards.org/versions/devel/install.html
Please have a go and let me know how you get on.
Thanks very much. I tried installing with pip install git+git://github.com/metawards/Metawards.git@devel
in Anaconda base. Initially, I got error messages about requiring Microsoft Visual C++ Build Tools, which I then installed. Now I get the following messages and error (apologies if I am doing something dumb - I've not used installed from GitHub before):
Collecting git+git://github.com/metawards/Metawards.git@devel
Cloning git://github.com/metawards/Metawards.git (to revision devel) to c:\users\my_username\appdata\local\temp\pip-req-build-jk6aj01s
Running command git clone -q git://github.com/metawards/Metawards.git 'C:\Users\my_username\AppData\Local\Temp\pip-req-build-jk6aj01s'
Requirement already satisfied: dateparser>=0.7.0 in c:\users\my_username\anaconda3\lib\site-packages (from metawards==1.5.1+27.g4e00a440) (1.0.0)
Requirement already satisfied: configargparse>=1.2.0 in c:\users\my_username\anaconda3\lib\site-packages (from metawards==1.5.1+27.g4e00a440) (1.4.1)
Requirement already satisfied: lazy_import>=0.2.2 in c:\users\my_username\anaconda3\lib\site-packages (from metawards==1.5.1+27.g4e00a440) (0.2.2)
Requirement already satisfied: rich>=4.2.0 in c:\users\my_username\anaconda3\lib\site-packages (from metawards==1.5.1+27.g4e00a440) (10.2.0)
Requirement already satisfied: yaspin>=0.18.0 in c:\users\my_username\anaconda3\lib\site-packages (from metawards==1.5.1+27.g4e00a440) (1.5.0)
Requirement already satisfied: tzlocal in c:\users\my_username\anaconda3\lib\site-packages (from dateparser>=0.7.0->metawards==1.5.1+27.g4e00a440) (2.1)
Requirement already satisfied: pytz in c:\users\my_username\anaconda3\lib\site-packages (from dateparser>=0.7.0->metawards==1.5.1+27.g4e00a440) (2019.3)
Requirement already satisfied: python-dateutil in c:\users\my_username\anaconda3\lib\site-packages (from dateparser>=0.7.0->metawards==1.5.1+27.g4e00a440) (2.8.0)
Requirement already satisfied: regex!=2019.02.19 in c:\users\my_username\anaconda3\lib\site-packages (from dateparser>=0.7.0->metawards==1.5.1+27.g4e00a440) (2021.4.4)
Requirement already satisfied: six in c:\users\my_username\anaconda3\lib\site-packages (from lazy_import>=0.2.2->metawards==1.5.1+27.g4e00a440) (1.12.0)
Requirement already satisfied: colorama<0.5.0,>=0.4.0 in c:\users\my_username\anaconda3\lib\site-packages (from rich>=4.2.0->metawards==1.5.1+27.g4e00a440) (0.4.1)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in c:\users\my_username\anaconda3\lib\site-packages (from rich>=4.2.0->metawards==1.5.1+27.g4e00a440) (2.9.0)
Requirement already satisfied: typing-extensions<4.0.0,>=3.7.4; python_version < "3.8" in c:\users\my_username\anaconda3\lib\site-packages (from rich>=4.2.0->metawards==1.5.1+27.g4e00a440) (3.10.0.0)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in c:\users\my_username\anaconda3\lib\site-packages (from rich>=4.2.0->metawards==1.5.1+27.g4e00a440) (0.9.1)
Building wheels for collected packages: metawards
Building wheel for metawards (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\my_username\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\my_username\\AppData\\Local\\Temp\\pip-req-build-jk6aj01s\\setup.py'"'"'; __file__='"'"'C:\\Users\\my_username\\AppData\\Local\\Temp\\pip-req-build-jk6aj01s\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\my_username\AppData\Local\Temp\pip-wheel-cnw8fbcf' --python-tag cp37 cwd: C:\Users\my_username\AppData\Local\Temp\pip-req-build-jk6aj01s\
Complete output (166 lines):
Compiling on Windows (AMD64)
Checking if the compiler supports openmp...
Checking if the compiler supports openmp flag /openmp
openmp_test.c
openmp_test.c(7): warning C4101: 'nthreads': unreferenced local variable
openmp_test.c(7): warning C4101: 'thread_id': unreferenced local variable
LINK : warning LNK4044: unrecognized option '/openmp'; ignored
Generating code
Finished generating code
Compiler supports openmp using flag /openmp. Excellent!
CFLAGS = /openmp
LFLAGS = /openmp
Number of builders equals 2
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\metawards
copying src\metawards\_demographic.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_demographics.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_disease.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_infections.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_inputfiles.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_interpret.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_link.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_links.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_network.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_networks.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_node.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_nodes.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_outputfiles.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_parameters.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_population.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_run.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_variableset.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_version.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_ward.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_wardid.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_wardinfo.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_wards.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_workspace.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\__init__.py -> build\lib.win-amd64-3.7\metawards
creating build\lib.win-amd64-3.7\metawards\analysis
copying src\metawards\analysis\_animate_plots.py -> build\lib.win-amd64-3.7\metawards\analysis
copying src\metawards\analysis\_summary_plot.py -> build\lib.win-amd64-3.7\metawards\analysis
copying src\metawards\analysis\__init__.py -> build\lib.win-amd64-3.7\metawards\analysis
creating build\lib.win-amd64-3.7\metawards\app
copying src\metawards\app\run.py -> build\lib.win-amd64-3.7\metawards\app
copying src\metawards\app\__init__.py -> build\lib.win-amd64-3.7\metawards\app
creating build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_custom.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_default.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_large.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_none.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_small.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_basic.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_final_report.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_incidence.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_prevalence.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_trajectory.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_wards_trajectory.py -> build\lib.win-amd64-3.7\metawards\extractors copying src\metawards\extractors\__init__.py -> build\lib.win-amd64-3.7\metawards\extractors
creating build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_advance_additional.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_custom.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_default.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_weekday.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_weekend.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_working_week.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_setup_imports.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\__init__.py -> build\lib.win-amd64-3.7\metawards\iterators
creating build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_interaction_matrix.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_custom.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_default.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_evenly.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_evenly_multi_population.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_evenly_single_population.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_none.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_none_multi_population.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_none_single_population.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\__init__.py -> build\lib.win-amd64-3.7\metawards\mixers
creating build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_go_isolate.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_go_stage.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_go_to.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_movegenerator.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_moverecord.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_move_custom.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_move_default.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\__init__.py -> build\lib.win-amd64-3.7\metawards\movers
creating build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\install.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\jupexe.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\plot.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\pyexe.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\retexe.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\update.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\__init__.py -> build\lib.win-amd64-3.7\metawards\scripts
creating build\lib.win-amd64-3.7\metawards\themes
copying src\metawards\themes\_simple.py -> build\lib.win-amd64-3.7\metawards\themes
copying src\metawards\themes\_spring_flowers.py -> build\lib.win-amd64-3.7\metawards\themes
copying src\metawards\themes\__init__.py -> build\lib.win-amd64-3.7\metawards\themes
creating build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_add_lookup.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_console.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_get_functions.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_import_module.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_initialise_infections.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_iterate_weekend.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_parallel.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_profiler.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_read_done_file.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_run_model.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_run_models.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_safe_eval.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_string_to_ints.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_updates.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_worker.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\__init__.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_get_array_ptr.pxd -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_ran_binomial.pxd -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_rate_to_prob.pxd -> build\lib.win-amd64-3.7\metawards\utils
UPDATING build\lib.win-amd64-3.7\metawards/_version.py
set build\lib.win-amd64-3.7\metawards/_version.py to '1.5.1+27.g4e00a440'
running build_clib
building 'metawards_random' library
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\src
creating build\temp.win-amd64-3.7\src\metawards
creating build\temp.win-amd64-3.7\src\metawards\ran_binomial
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/metawards/ran_binomial\mt19937.c /Fobuild\temp.win-amd64-3.7\src/metawards/ran_binomial\mt19937.obj
mt19937.c
src/metawards/ran_binomial\mt19937.c(87): warning C4146: unary minus operator applied to unsigned type, result still unsigned
src/metawards/ran_binomial\mt19937.c(91): warning C4146: unary minus operator applied to unsigned type, result still unsigned
src/metawards/ran_binomial\mt19937.c(94): warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/metawards/ran_binomial\distributions.c /Fobuild\temp.win-amd64-3.7\src/metawards/ran_binomial\distributions.obj
distributions.c
src/metawards/ran_binomial\distributions.c(40): warning C4244: 'return': conversion from 'double' to 'float', possible loss of data
src/metawards/ran_binomial\distributions.c(537): warning C4244: 'function': conversion from 'int64_t' to 'double', possible loss of data
src/metawards/ran_binomial\distributions.c(675): warning C4244: '=': conversion from 'int64_t' to 'double', possible loss of data
src/metawards/ran_binomial\distributions.c(676): warning C4244: '=': conversion from 'int64_t' to 'double', possible loss of data
src/metawards/ran_binomial\distributions.c(677): warning C4244: '=': conversion from 'int64_t' to 'double', possible loss of data
src/metawards/ran_binomial\distributions.c(678): warning C4244: '=': conversion from 'int64_t' to 'double', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\lib.exe
build\temp.win-amd64-3.7\src/metawards/ran_binomial\mt19937.obj build\temp.win-amd64-3.7\src/metawards/ran_binomial\distributions.obj /OUT:build\temp.win-amd64-3.7\metawards_random.lib
Microsoft (R) Library Manager Version 14.28.29915.0
Copyright (C) Microsoft Corporation. All rights reserved.
running build_ext
building 'metawards.utils._add_wards_network_distance' extension
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
creating build\temp.win-amd64-3.7\Release\src\metawards
creating build\temp.win-amd64-3.7\Release\src\metawards\utils
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\my_username\Anaconda3\include -IC:\Users\my_username\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/metawards/utils\_add_wards_network_distance.c /Fobuild\temp.win-amd64-3.7\Release\src/metawards/utils\_add_wards_network_distance.obj /openmp _
add_wards_network_distance.c
c1: fatal error C1083: Cannot open source file: 'src/metawards/utils\_add_wards_network_distance.c':
No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for metawards
Running setup.py clean for metawards
Failed to build metawards
Installing collected packages: metawards
Running setup.py install for metawards ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\my_username\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\my_username\\AppData\\Local\\Temp\\pip-req-build-jk6aj01s\\setup.py'"'"'; __file__='"'"'C:\\Users\\my_username\\AppData\\Local\\Temp\\pip-req-build-jk6aj01s\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\my_username\AppData\Local\Temp\pip-record-vf5u2y1z\install-record.txt' --single-version-externally-managed --compile cwd: C:\Users\my_username\AppData\Local\Temp\pip-req-build-jk6aj01s\
Complete output (146 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\metawards
copying src\metawards\_demographic.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_demographics.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_disease.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_infections.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_inputfiles.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_interpret.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_link.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_links.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_network.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_networks.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_node.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_nodes.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_outputfiles.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_parameters.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_population.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_run.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_variableset.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_version.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_ward.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_wardid.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_wardinfo.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_wards.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\_workspace.py -> build\lib.win-amd64-3.7\metawards
copying src\metawards\__init__.py -> build\lib.win-amd64-3.7\metawards
creating build\lib.win-amd64-3.7\metawards\analysis
copying src\metawards\analysis\_animate_plots.py -> build\lib.win-amd64-3.7\metawards\analysis
copying src\metawards\analysis\_summary_plot.py -> build\lib.win-amd64-3.7\metawards\analysis
copying src\metawards\analysis\__init__.py -> build\lib.win-amd64-3.7\metawards\analysis
creating build\lib.win-amd64-3.7\metawards\app
copying src\metawards\app\run.py -> build\lib.win-amd64-3.7\metawards\app
copying src\metawards\app\__init__.py -> build\lib.win-amd64-3.7\metawards\app
creating build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_custom.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_default.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_large.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_none.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_extract_small.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_basic.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_final_report.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_incidence.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_prevalence.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_trajectory.py -> build\lib.win-amd64-3.7\metawards\extractors
copying src\metawards\extractors\_output_wards_trajectory.py -> build\lib.win-amd64-3.7\metawards\extractors copying src\metawards\extractors\__init__.py -> build\lib.win-amd64-3.7\metawards\extractors
creating build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_advance_additional.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_custom.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_default.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_weekday.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_weekend.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_iterate_working_week.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\_setup_imports.py -> build\lib.win-amd64-3.7\metawards\iterators
copying src\metawards\iterators\__init__.py -> build\lib.win-amd64-3.7\metawards\iterators
creating build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_interaction_matrix.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_custom.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_default.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_evenly.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_evenly_multi_population.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_evenly_single_population.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_none.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_none_multi_population.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\_mix_none_single_population.py -> build\lib.win-amd64-3.7\metawards\mixers
copying src\metawards\mixers\__init__.py -> build\lib.win-amd64-3.7\metawards\mixers
creating build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_go_isolate.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_go_stage.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_go_to.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_movegenerator.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_moverecord.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_move_custom.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\_move_default.py -> build\lib.win-amd64-3.7\metawards\movers
copying src\metawards\movers\__init__.py -> build\lib.win-amd64-3.7\metawards\movers
creating build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\install.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\jupexe.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\plot.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\pyexe.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\retexe.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\update.py -> build\lib.win-amd64-3.7\metawards\scripts
copying src\metawards\scripts\__init__.py -> build\lib.win-amd64-3.7\metawards\scripts
creating build\lib.win-amd64-3.7\metawards\themes
copying src\metawards\themes\_simple.py -> build\lib.win-amd64-3.7\metawards\themes
copying src\metawards\themes\_spring_flowers.py -> build\lib.win-amd64-3.7\metawards\themes
copying src\metawards\themes\__init__.py -> build\lib.win-amd64-3.7\metawards\themes
creating build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_add_lookup.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_console.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_get_functions.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_import_module.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_initialise_infections.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_iterate_weekend.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_parallel.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_profiler.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_read_done_file.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_run_model.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_run_models.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_safe_eval.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_string_to_ints.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_updates.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_worker.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\__init__.py -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_get_array_ptr.pxd -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_ran_binomial.pxd -> build\lib.win-amd64-3.7\metawards\utils
copying src\metawards\utils\_rate_to_prob.pxd -> build\lib.win-amd64-3.7\metawards\utils
UPDATING build\lib.win-amd64-3.7\metawards/_version.py
set build\lib.win-amd64-3.7\metawards/_version.py to '1.5.1+27.g4e00a440'
running build_clib
building 'metawards_random' library
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\src
creating build\temp.win-amd64-3.7\src\metawards
creating build\temp.win-amd64-3.7\src\metawards\ran_binomial
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/metawards/ran_binomial\mt19937.c /Fobuild\temp.win-amd64-3.7\src/metawards/ran_binomial\mt19937.obj
mt19937.c
src/metawards/ran_binomial\mt19937.c(87): warning C4146: unary minus operator applied to unsigned type, result still unsigned
src/metawards/ran_binomial\mt19937.c(91): warning C4146: unary minus operator applied to unsigned type, result still unsigned
src/metawards/ran_binomial\mt19937.c(94): warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/metawards/ran_binomial\distributions.c /Fobuild\temp.win-amd64-3.7\src/metawards/ran_binomial\distributions.obj
distributions.c
src/metawards/ran_binomial\distributions.c(40): warning C4244: 'return': conversion from 'double' to 'float', possible loss of data
src/metawards/ran_binomial\distributions.c(537): warning C4244: 'function': conversion from 'int64_t' to 'double', possible loss of data
src/metawards/ran_binomial\distributions.c(675): warning C4244: '=': conversion from 'int64_t' to 'double', possible loss of data
src/metawards/ran_binomial\distributions.c(676): warning C4244: '=': conversion from 'int64_t' to 'double', possible loss of data
src/metawards/ran_binomial\distributions.c(677): warning C4244: '=': conversion from 'int64_t' to 'double', possible loss of data
src/metawards/ran_binomial\distributions.c(678): warning C4244: '=': conversion from 'int64_t' to 'double', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\lib.exe build\temp.win-amd64-3.7\src/metawards/ran_binomial\mt19937.obj build\temp.win-amd64-3.7\src/metawards/ran_binomial\distributions.obj /OUT:build\temp.win-amd64-3.7\metawards_random.lib
Microsoft (R) Library Manager Version 14.28.29915.0
Copyright (C) Microsoft Corporation. All rights reserved.
running build_ext
building 'metawards.utils._add_wards_network_distance' extension
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
creating build\temp.win-amd64-3.7\Release\src\metawards
creating build\temp.win-amd64-3.7\Release\src\metawards\utils
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\my_username\Anaconda3\include -IC:\Users\my_username\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/metawards/utils\_add_wards_network_distance.c /Fobuild\temp.win-amd64-3.7\Release\src/metawards/utils\_add_wards_network_distance.obj
_add_wards_network_distance.c
c1: fatal error C1083: Cannot open source file: 'src/metawards/utils\_add_wards_network_distance.c': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\my_username\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\my_username\\AppData\\Local\\Temp\\pip-req-build-jk6aj01s\\setup.py'"'"'; __file__='"'"'C:\\Users\\my_username\\AppData\\Local\\Temp\\pip-req-build-jk6aj01s\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\my_username\AppData\Local\Temp\pip-record-vf5u2y1z\install-record.txt' --single-version-externally-managed --compile
Check the logs for full command output.
Thanks - that error is because cython has not been called to create the .c
files from the .pyx
files. GitHub holds just the cython .pyx
files - the cython parser then needs to be called to convert those into .c
files that can be compiled.
You need to set the CYTHONIZE
environment variable to 1
to tell the build to do that. I think you can do this by typing;
$env.CYTHONIZE=1
pip install git+git://github.com/metawards/Metawards.git@devel
(sorry, my windows is very rusty)
Alternatively you can just download the binary package directly from GitHub Actions here - https://github.com/metawards/MetaWards/actions/runs/842871214
Just unzip the dist.zip
that is linked to at the bottom of the page and then pip install the appropriate file (the wheel built for Windows with Python 3.7 (pip install metawards-1.5.1+27.g4e00a440-cp37-cp37m-win_amd64.whl).
p.s. I didn't know you could pip install directly from GitHub like that - nice to learn new things :-)
Thanks for walking me through that!
It has installed and the run function now appears to start normally, but has not finished one day later. The output so far is displayed below:
─────────────────────────────────────────── INFO ────────────────────────────────────────────
Writing output to directory C:\Users\my_username\Documents\output
─────────────────────────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────── INFO ────────────────────────────────────────────
[RUNNING] C:\Users\my_username\Anaconda3\metawards.exe --force-overwrite-output --output output
--disease C:\Users\my_username\Documents\input_sczah3ye\disease.json
--model C:\Users\my_username\Documents\input_sczah3ye\model.json.bz2
--theme simple --no-spinner --no-progress
─────────────────────────────────────────────────────────────────────────────────────────────
+----------------------------------------------------------------------+
| |
| +--------------------------------------------------------------+ |
| | MetaWards version 1.5.1+27.g4e00a440 | |
| +--------------------------------------------------------------+ |
| |
| +--------------------------------------------------------------+ |
| | https://metawards.org | |
| +--------------------------------------------------------------+ |
| |
| +--------------------------------------------------------------+ |
| | Source information | |
| +--------------------------------------------------------------+ |
| |
| repository: https://github.com/metawards/MetaWards |
| branch: devel |
| revision: 4e00a4404b16551d88f31415e07819fb7379e282 |
| last modified: 2021-05-14T18:06:26+0100 |
| |
| WARNING: MetaWardsData cannot be found! Please see |
| https://metawards.org/model_data for instructions on how to |
| download and install this necessary data. |
| |
| +--------------------------------------------------------------+ |
| | Additional information | |
| +--------------------------------------------------------------+ |
| |
| Visit https://metawards.org for more information about |
| metawards, its authors and its license |
| |
+----------------------------------------------------------------------+
--------------------------------- Initialise ----------------------------------
Performing a single run of each set of parameters
Naming output subdirectories using a run's fingerprint
Number of threads to use for each model run is 8
Day zero is Wednesday May 19 2021
That's good to hear. I think that the code is freezing because you have not downloaded the MetaWardsData data files. Normally these calculations should take just a second or two (or a minute if you are using the full UK model). They won't take a whole day ;-).
The header that is printed says that you have downloaded MetaWardsData. Please download it and put it into either your home directory, or into the "GitHub" folder in your home directory (these are the standard search paths - if you want to put it in a different directory then set the "METAWARDSDATA" environment variable equal to the location - see here for details).
Once you have downloaded the data you will need to run the version
script to add versioning data. To do this, change into the MetaWardsData directory and run ./version
. You only need to do this once.
Then, when you run MetaWards again, you should see in the header that it has found the MetaWardsData file. For example, the header output on my machine is;
┌──────────────────────────────────────────────────────────────────────┐
│ │
│ ╔══════════════════════════════════════════════════════════════╗ │
│ ║ MetaWards version 1.5.1+36.g5d0496d2 ║ │
│ ╚══════════════════════════════════════════════════════════════╝ │
│ │
│ ╔══════════════════════════════════════════════════════════════╗ │
│ ║ https://metawards.org ║ │
│ ╚══════════════════════════════════════════════════════════════╝ │
│ │
│ ╔══════════════════════════════════════════════════════════════╗ │
│ ║ Source information ║ │
│ ╚══════════════════════════════════════════════════════════════╝ │
│ │
│ • repository: https://github.com/metawards/MetaWards │
│ • branch: feature_weekend │
│ • revision: 5d0496d2eef5eb1ab49ea8e7fae45418c6e01466 │
│ • last modified: 2021-05-21T17:47:23+0100 │
│ │
│ ╔══════════════════════════════════════════════════════════════╗ │
│ ║ MetaWardsData information ║ │
│ ╚══════════════════════════════════════════════════════════════╝ │
│ │
│ • version: 1.1.1 │
│ • repository: https://github.com/metawards/MetaWardsData │
│ • branch: main │
│ │
│ ╔══════════════════════════════════════════════════════════════╗ │
│ ║ Additional information ║ │
│ ╚══════════════════════════════════════════════════════════════╝ │
│ │
│ Visit https://metawards.org for more information about │
│ metawards, its authors and its license │
│ │
└──────────────────────────────────────────────────────────────────────┘
Hopefully it should then work.
It worked! Thanks so much for going through all of that with me!
The previous basic example of 1 home ward only works fine. However, running the version script doesn't seem to have worked: The version.txt file created says: {"version": None,"repository": None,"branch": None,"is_dirty": false}
And this is reflected in the errors:
------------------------------------ ERROR ------------------------------------
Could not find the repository version info in
C:\Users\my_username\GitHub\MetaWardsData\version.txt. Please make sure
that you have run './version' in that repository to generate the version
info.
-------------------------------------------------------------------------------
+----------------------------------------------------------------------+
| |
| +--------------------------------------------------------------+ |
| | MetaWards version 1.5.1+27.g4e00a440 | |
| +--------------------------------------------------------------+ |
| |
| +--------------------------------------------------------------+ |
| | https://metawards.org | |
| +--------------------------------------------------------------+ |
| |
| +--------------------------------------------------------------+ |
| | Source information | |
| +--------------------------------------------------------------+ |
| |
| repository: https://github.com/metawards/MetaWards |
| branch: devel |
| revision: 4e00a4404b16551d88f31415e07819fb7379e282 |
| last modified: 2021-05-14T18:06:26+0100 |
| |
| +--------------------------------------------------------------+ |
| | MetaWardsData information | |
| +--------------------------------------------------------------+ |
| |
| version: unknown |
| repository: unknown |
| branch: unknown |
| |
| WARNING: This data has not been committed to git. You may not be |
| able to reproduce this run. |
| |
| +--------------------------------------------------------------+ |
| | Additional information | |
| +--------------------------------------------------------------+ |
| |
| Visit https://metawards.org for more information about |
| metawards, its authors and its license |
| |
+----------------------------------------------------------------------+
--------------------------------- Initialise ----------------------------------
Performing a single run of each set of parameters
Naming output subdirectories using a run's fingerprint
Number of threads to use for each model run is 8
Day zero is Monday May 24 2021
Using MetaWardsData at C:\Users\my_username\GitHub\MetaWardsData
----------------------------------- WARNING -----------------------------------
This repository is dirty, meaning that the datahas not been committed to git.
This may make this calculation very difficult to reproduce
-------------------------------------------------------------------------------
I don't know if this is related, but running a model in which I add another work ward also freezes. i.e. I run
import metawards as mw
import pandas as pd
import matplotlib.pyplot as plt
# define disease
lurgy = mw.Disease(name="lurgy")
lurgy.add("E", beta=0.0, progress=0.5) #beta = infectivity, progress = % that progress to next stage per day
lurgy.add("I", beta=0.8, progress=0.25)
lurgy.add("R")
#define network
home = mw.Ward(name="home")
home.set_num_players(10000)
work = mw.Ward("work")
home.add_workers(7500, destination=work)
network = mw.Wards()
network.add(home)
network.add(work)
# run the model
results = mw.run(disease=lurgy, model=network,
additional="1, 100, home")
and the point at which it freezes is after the lines:
---------------------- Running the model using 8 threads ----------------------
------------------------------------ Day 0 ------------------------------------
S: 17500 E: 0 I: 0 R: 0 IW: 0 POPULATION: 17500
------------------------------------ Day 1 ------------------------------------
Loading additional seeds from the command line
Thanks - the error messages are just warnings that you can't version the MetaWardsData (likely because you don't have git available). This means that MetaWards cannot verify that the version of the data is correct, so writes some warnings that the run may not be reproducible. This is nothing to worry about as you are not changing MetaWardsData.
The freeze is more concerning. I will look into this. Runs should take seconds when you only have a small number of wards, so something has gone wrong (even when using the full UK model, a run should take around one minute).
Thanks - I've found the problems. The hangs were caused by metawards freezing whenever anything was written to error. I've fixed this, with error now redirected to output. The error was that Windows didn't like me using single quotes for the additional seeds argument. I've switched this over to use double quotes, and it now runs. I am running some tests, and hope to get this new code merged into the devel branch soon (and, indeed, pushed to the 1.6 release, as I want to get this out this week).
This should now be fixed. I've just published MetaWards 1.6.0 and have tested and can confirm that this now works. Please update to MetaWards 1.6.0 (e.g. pip install metawards==1.6.0
) and let me know if this now works for you :-)
Thanks very much, it works!!
Describe the bug After installation via pip, models cannot run and give "Cannot find the metawards executable" error
Steps taken
pip install metawards
lurgy = mw.Disease(name="lurgy") lurgy.add("E", beta=0.0, progress=0.5) lurgy.add("I", beta=0.8, progress=0.25) lurgy.add("R") print(lurgy)
home = mw.Ward(name="home") home.set_num_players(10000) print(home)
results = mw.run(model=home, disease=lurgy)
──────────────────────────────────── ERROR ──────────────────────────────────── Cannot find the metawards executable: C:\Users\my_username\Anaconda3\envs\my_env_name\metawards ────────────────────────────────────────────────────────────