pypr/pysph

I get "OSError: [WinError 6] The handle is invalid" when trying to run pysph examples

githubrho opened this issue · 6 comments

How to solve this?

@prabhuramachandran

Running example pysph.examples.cube.

Information for example: pysph.examples.cube
A very simple example to help benchmark PySPH. (2 minutes)

The example creates a cube shaped block of water falling in free-space under
the influence of gravity while solving the incompressible, inviscid flow
equations. Only 5 time steps are solved but with a million particles. It is
easy to change the number of particles by simply passing the command line
argument --np to a desired number::

$ pysph run cube --np 2e6

To check the performance of PySPH using OpenMP one could try the following::

$ pysph run cube --disable-output

$ pysph run cube --disable-output --openmp

Number of particles: 103823
Generating output in C:\Users---\cube_output
Compiling code at: C:\Users---.pysph\source\py3.7-win-amd64\m_30bb3da0068142637bd63ff68cf26310.pyx
Traceback (most recent call last):
File "c:\users---\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users---\anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users---\Anaconda3\Scripts\pysph.exe_main
.py", line 9, in
File "c:\users---\anaconda3\lib\site-packages\pysph\tools\cli.py", line 69, in main
args.func(extra)
File "c:\users---\anaconda3\lib\site-packages\pysph\tools\cli.py", line 16, in run_examples
main(args)
File "c:\users---\anaconda3\lib\site-packages\pysph\examples\run.py", line 203, in main
run_command(module, args.split())
File "c:\users---\anaconda3\lib\site-packages\pysph\examples\run.py", line 147, in run_command
_exec_file(filename)
File "c:\users---\anaconda3\lib\site-packages\pysph\examples\run.py", line 21, in _exec_file
exec(co, ns)
File "c:\users---\anaconda3\lib\site-packages\pysph\examples\cube.py", line 88, in
app.run()
File "c:\users---\anaconda3\lib\site-packages\pysph\solver\application.py", line 1402, in run
self._configure()
File "c:\users---\anaconda3\lib\site-packages\pysph\solver\application.py", line 1126, in _configure
fixed_h=fixed_h)
File "c:\users---\anaconda3\lib\site-packages\pysph\solver\solver.py", line 203, in setup
sph_compiler.compile()
File "c:\users---\anaconda3\lib\site-packages\pysph\sph\sph_compiler.py", line 38, in compile
mod = helper0.compile(code0)
File "c:\users---\anaconda3\lib\site-packages\pysph\sph\acceleration_eval_cython_helper.py", line 172, in compile
self._module = self._ext_mod.load()
File "c:\users---\anaconda3\lib\site-packages\pysph\cpy\ext_module.py", line 266, in load
self.build()
File "c:\users---\anaconda3\lib\site-packages\pysph\cpy\ext_module.py", line 244, in build
setup_args={'script_args': script_args}
File "c:\users---\anaconda3\lib\site-packages\pyximport\pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "c:\users---\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users---\anaconda3\lib\distutils\dist.py", line 982, in run_command
log.info("running %s", command)
File "c:\users---\anaconda3\lib\distutils\log.py", line 46, in info
self._log(INFO, msg, args)
File "c:\users---\anaconda3\lib\distutils\log.py", line 31, in _log
stream.write('%s\n' % msg)
OSError: [WinError 6] The handle is invalid

@githubrho -- you will need to install both compyle and pysph from github. I apologize for not pushing out releases for these and these are long pending but my semester has become never-ending and I have not had a break for a while. For now please try the following:

pip uninstall pysph compyle
pip install https://github.com/pypr/compyle/zipball/master
pip install https://github.com/pypr/pysph/zipball/master

Hope this helps.

@prabhuramachandran
Thanks for your reply, I totally understand, I am a professor myself - actually trying to work with some undergrads to apply SPH to solar system evolution. Cheers

@githubrho -- great, thank you!

got the following:

ERROR: spyder 5.0.3 requires pyqtwebengine<5.13, which is not installed.
ERROR: conda-repo-cli 1.0.4 requires pathlib, which is not installed.
ERROR: spyder 5.0.3 has requirement pyqt5<5.13, but you'll have pyqt5 5.15.4 which is incompatible.

I can probably live with using an editor other than spyder, but is the pathlib installation absolutely necessary?

also unable run examples:

...File "pysph\base\particle_array.pyx", line 1, in init pysph.base.particle_array
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

fixed: uninstalled then reinstalled numpy