0

As a context, I work on Windows 10 machine and did update pip (23.1.2) and python (3.11.3)

I am trying to run an open source code that is a bit old (this one if that helps -> https://github.com/locuslab/lcp-physics/tree/master). There are two requirements: install pygames and py3ode. It worked fine for pygames but I couldn't install py3ode.

I also tried to clone the open source code of py3ode and use it in a local copy on Pycharm but I did not manage to write the right import and calls for my code to understand the py3ode references.

Here are more details

I tried pip install py3ode with latest version of pip and python and I also tried on a virtual env with pip v9.0.3 and python (3.6.2) that I think were what they would be using back then. Same error:

Collecting Py3ODE
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/bf/67/afc9c84e906e8510c34cea5e21644fbeb4568505e5c7a044840ede9329a3/Py3ODE-1.2.0.dev15.tar.gz (594kB)
    100% |████████████████████████████████| 604kB 1.9MB/s
    Complete output from command python setup.py egg_info:
    'ode-config' is not recognized as an internal or external command,
    operable program or batch file.
    'ode-config' is not recognized as an internal or external command,
    operable program or batch file.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\tom\AppData\Local\Temp\pip-build-_uy3tlu9\Py3ODE\setup.py", line 142, in <module>
        install_ode()
      File "C:\Users\tom\AppData\Local\Temp\pip-build-_uy3tlu9\Py3ODE\setup.py", line 125, in install_ode
        subprocess.check_call(['./install_ode.sh', install_dir])
      File "C:\Users\tom\AppData\Local\anaconda3\envs\myenvTest\lib\subprocess.py", line 286, in check_call
        retcode = call(*popenargs, **kwargs)
      File "C:\Users\tom\AppData\Local\anaconda3\envs\myenvTest\lib\subprocess.py", line 267, in call
        with Popen(*popenargs, **kwargs) as p:
      File "C:\Users\tom\AppData\Local\anaconda3\envs\myenvTest\lib\subprocess.py", line 707, in __init__
        restore_signals, start_new_session)
      File "C:\Users\tom\AppData\Local\anaconda3\envs\myenvTest\lib\subprocess.py", line 992, in _execute_child
        startupinfo)
    OSError: [WinError 193] %1 is not a valid Win32 application
    WARNING: <ode/ode.h> not found. Downloading and installing it now to your home directory.
    If it's already installed you may have to adjust INC_DIRS in setup.py.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\tom\AppData\Local\Temp\pip-build-_uy3tlu9\Py3ODE\

I also tried to clone the code of py3ode which I think is this one: https://github.com/filipeabperes/Py3ODE. Here is my architecture, I put the code of Py3ODE in the folder "ode_fold" and I want to run demo.py in lcp-physics>demos enter image description here

demo.py calls bodies.py that has some errors on the following lines

...
import ode
...
ode.GeomBox(...)

enter image description here

enter image description here

I believe that the "import ode" refers to ode.pyx in ode_fold>src>ode.pyx but I cannot write import ode.pyx. I can only write import ode_fold so on the lines when I write ode.GeomBox it doesn't find the attribute GeomBox. Of course I cannot write either ode_fold.src.ode.GeomBox but that's kind of what I would like to "say"...

Looking on the internet, I have been told to replace import doe.pyx by

import pyximport
pyximport.install()
from ode_fold.src import ode

but I then have a compilation error of Cython that I have never used so I have no idea how to fix that and I feel like I am going to the wrong direction with Cython

C:\Users\tom\AppData\Local\anaconda3\envs\chrono_venv4\Lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\tom\...\Workspace\lcp-physics\ode_fold\src\ode.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)

Error compiling Cython file:
------------------------------------------------------------
...
include "geoms.pyx"

# Include the generated trimesh switch file that either includes the real
# trimesh wrapper (trimesh.pyx/trimeshdata.pyx) or a dummy wrapper
# (trimesh_dummy.pyx) if trimesh support is not available/desired.
include "_trimesh_switch.pyx"
^
------------------------------------------------------------

C:\Users\tom\...\Workspace\lcp-physics\ode_fold\src\ode.pyx:187:0: '_trimesh_switch.pyx' not found
...
ImportError: Building module ode_fold.src.ode failed: ["distutils.errors.CompileError: command 'C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Community\\\\VC\\\\Tools\\\\MSVC\\\\14.36.32532\\\\bin\\\\HostX86\\\\x64\\\\cl.exe' failed with exit code 2\n"]

Can someone help me figure out how to tell the first code to refer to the py3ode that I cloned? If you have an idea on the pip install I would take it too but I think here it is probably too old and might not work anymore

Thanks a lot!

Tom242
  • 1

0 Answers0