csu-hmc / opty

A library for using direct collocation in the optimization of dynamic systems.
http://opty.readthedocs.io
Other
86 stars 20 forks source link

I get an error: ModuleNotFoundError: No module named 'ufuncify_matrix_0' #148

Closed Peter230655 closed 1 month ago

Peter230655 commented 1 month ago

I am trying to simulate the jumping lamp as described in the article Spacetime Constraints by Andrew Witkin and Michael Kass. I do it in 2D for simplicity, and I run it in the sympy-dev environment given to me by @tjstienstra (same environment I use for all my opty simulations). I get the error below. I got it earlier, too - but then there was an issue with the environment. NB: Just as earlier, if I run it again, the error : ModuleNotFoundError: No module named 'ufuncifymatrix0' changes to ModuleNotFoundError: No module named 'ufuncifymatrix1' Any help is greatly appreciated!

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[5], [line 88](vscode-notebook-cell:?execution_count=5&line=88)
     [85](vscode-notebook-cell:?execution_count=5&line=85) g_list        = []                        # list to store the values of the errors
     [87](vscode-notebook-cell:?execution_count=5&line=87) for i in range(10): 
---> [88](vscode-notebook-cell:?execution_count=5&line=88)     prob = Problem(obj, obj_grad, EOM, state_symbols, num_nodes, interval_value,
     [89](vscode-notebook-cell:?execution_count=5&line=89)         known_parameter_map=par_map,
     [90](vscode-notebook-cell:?execution_count=5&line=90)         instance_constraints=instance_constraints,
     [91](vscode-notebook-cell:?execution_count=5&line=91) #        bounds=bounds,
     [92](vscode-notebook-cell:?execution_count=5&line=92)         integration_method=methode)
     [94](vscode-notebook-cell:?execution_count=5&line=94)     prob.add_option('max_iter', 6000)           # default is 3000
     [96](vscode-notebook-cell:?execution_count=5&line=96) # Find the optimal solution.

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\opty\direct_collocation.py:53](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:53), in _DocInherit.get_with_inst.<locals>.f(*args, **kwargs)
     [51](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:51) @wraps(self.mthd, assigned=('__name__', '__module__'))
     [52](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:52) def f(*args, **kwargs):
---> [53](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:53)     return self.mthd(obj, *args, **kwargs)

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\opty\direct_collocation.py:119](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:119), in Problem.__init__(self, obj, obj_grad, *args, **kwargs)
    [117](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:117) self.obj = obj
    [118](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:118) self.obj_grad = obj_grad
--> [119](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:119) self.con = self.collocator.generate_constraint_function()
    [120](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:120) logging.info('Constraint function generated.')
    [121](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:121) self.con_jac = self.collocator.generate_jacobian_function()

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\opty\direct_collocation.py:1463](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:1463), in ConstraintCollocator.generate_constraint_function(self)
   [1460](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:1460) """Returns a function which evaluates the constraints given the
   [1461](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:1461) array of free optimization variables."""
   [1462](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:1462) logging.info('Generating constraint function.')
-> [1463](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:1463) self._gen_multi_arg_con_func()
   [1464](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:1464) return self._wrap_constraint_funcs(self._multi_arg_con_func, 'con')

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\opty\direct_collocation.py:930](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:930), in ConstraintCollocator._gen_multi_arg_con_func(self)
    [927](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:927)     adjacent_stop = None
    [929](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:929) logging.info('Compiling the constraint function.')
--> [930](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:930) f = ufuncify_matrix(args, self.discrete_eom,
    [931](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:931)                     const=constant_syms + (h_sym,),
    [932](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:932)                     tmp_dir=self.tmp_dir, parallel=self.parallel)
    [934](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:934) def constraints(state_values, specified_values, constant_values,
    [935](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:935)                 interval_value):
    [936](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:936)     """Returns a vector of constraint values given all of the
    [937](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:937)     unknowns in the equations of motion over the 2, ..., N time
    [938](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:938)     steps.
   (...)
    [957](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:957) 
    [958](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/direct_collocation.py:958)     """

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\opty\utils.py:476](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/utils.py:476), in ufuncify_matrix(args, expr, const, tmp_dir, parallel)
    [473](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/utils.py:473)     cmd = [sys.executable, d['file_prefix'] + '_setup.py', 'build_ext',
    [474](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/utils.py:474)            '--inplace']
    [475](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/utils.py:475)     subprocess.call(cmd, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
--> [476](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/utils.py:476)     cython_module = importlib.import_module(d['file_prefix'])
    [477](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/utils.py:477) finally:
    [478](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/opty/utils.py:478)     module_counter += 1

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\importlib\__init__.py:126](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/importlib/__init__.py:126), in import_module(name, package)
    [124](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/importlib/__init__.py:124)             break
    [125](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/importlib/__init__.py:125)         level += 1
--> [126](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/importlib/__init__.py:126) return _bootstrap._gcd_import(name[level:], package, level)

File <frozen importlib._bootstrap>:1206, in _gcd_import(name, package, level)

File <frozen importlib._bootstrap>:1178, in _find_and_load(name, import_)

File <frozen importlib._bootstrap>:1142, in _find_and_load_unlocked(name, import_)

ModuleNotFoundError: No module named 'ufuncify_matrix_0'
moorepants commented 1 month ago

It means the C compliation failed. You've reported the issue before and the cause was that you were using symbols that are not compatible with C, for example Symbol('I_{xx}'). It can also occur if you don't have a compiler installed, but Timo helped you with that before.

Peter230655 commented 1 month ago

I remember, that initially I did not have the C compiler, and Timo installed it for me. I also remember the issue with these Symbol('I_{xx]'), so now I avoid them. But, frankly, I do not remember what other symbols are to be avoided. Thanks!

tjstienstra commented 1 month ago

But, frankly, I do not remember what other symbols are to be avoided.

Rule of thumb: any symbol name that would give a SyntaxError in Python as well, e.g. I_{xx} = 1 would also give an error in C.

tjstienstra commented 1 month ago

Hint when debugging: You can specify tmp_dir when instantiating your opty.direct_collocation.Problem. If you do so I think that it will actually create those cython files in there allowing you to easily read them to see what is wrong.

Peter230655 commented 1 month ago

Thanks! How exactly would I specify _tempdir ? (You know that I am an idiot in these matters)

moorepants commented 1 month ago

These things are found in the documentation: https://opty.readthedocs.io/en/latest/api.html

Search that page for tmp_dir.

Peter230655 commented 1 month ago

I found it as an argument in opty.utils.ufuncify_matrix. there is another argument expr. Would this be EOM in my case? Thanks!

moorepants commented 1 month ago

It is an argument to Problem also.

Peter230655 commented 1 month ago

Found it there, thanks! (Now I need my son to help me create a path to a directory)

Peter230655 commented 1 month ago

I tried to integrate my jumping lamp with pydy.System, to check if my EOMs seem right. I use: sys.generate_ode_function(generator='cython'), which JM had told me to speed up things. This generator = 'cython' worked perfectly well with another program, but here I get this error: Exception: Failed to compile and import Cython module. Could this be related to my problem with opty?

I use the same environment (sympy-dev) given to me by Timo -but maybe I screwed up something?

Thanks!

moorepants commented 1 month ago

Yes, it is likely the same issue. You have to look at the generated C code to see the issue.

Peter230655 commented 1 month ago

Thanks! To ensure there is no issue with my environment, I copied the relevant cells of the jumping lamp to a program, where _sys.generate_odefunction(generator='cython') worked - and with the jumping lamp it did not work.

Is there a way to look at the C code with pydy.System? (I looked in the documentation, but could not find anything,...., that's stupid me!)

moorepants commented 1 month ago
sys.generate_ode_function(generator='cython', verbose=True)
Peter230655 commented 1 month ago

Thanks! I use this code:

_sys = System(KM)
sys.constants = par_map 
sys.initial_conditions = {wert: initial_state_constraints[wert] for wert in qL}
print('sys initial conditions', sys.initial_conditions)
sys.times = np.linspace(0., intervall, int(schritte*intervall))
sys.generate_ode_function(generator='cython', verbose=True)
resultat = sys.integrate()_

And now I get this error message, which seems to look similar to what I get without verbose=True.

TypeError                                 Traceback (most recent call last)
File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\pydy\codegen\ode_function_generators.py:907](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:907), in generate_ode_function(*args, **kwargs)
    [905](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:905) try:
    [906](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:906)     # See if user passed in a custom class.
--> [907](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:907)     g = generator(*args, **kwargs)
    [908](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:908) except TypeError:
    [909](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:909)     # See if user passed in a string.

TypeError: 'str' object is not callable

During handling of the above exception, another exception occurred:

CalledProcessError                        Traceback (most recent call last)
File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\pydy\codegen\cython_code.py:222](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:222), in CythonMatrixGenerator.compile(self, tmp_dir, verbose)
    [220](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:220) cmd = [sys.executable, self.prefix + '_setup.py', 'build_ext',
    [221](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:221)        '--inplace']
--> [222](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:222) output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
    [223](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:223) if verbose:

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\subprocess.py:465](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/subprocess.py:465), in check_output(timeout, *popenargs, **kwargs)
    [463](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/subprocess.py:463)     kwargs['input'] = empty
--> [465](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/subprocess.py:465) return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    [466](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/subprocess.py:466)            **kwargs).stdout

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\subprocess.py:569](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/subprocess.py:569), in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    [568](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/subprocess.py:568)     if check and retcode:
--> [569](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/subprocess.py:569)         raise CalledProcessError(retcode, process.args,
    [570](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/subprocess.py:570)                                  output=stdout, stderr=stderr)
    [571](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/subprocess.py:571) return CompletedProcess(process.args, retcode, stdout, stderr)

CalledProcessError: Command '['c:\\Users\\Peter\\anaconda3\\envs\\sympy-dev\\python.exe', 'pydy_codegen_4_setup.py', 'build_ext', '--inplace']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
Cell In[99], [line 46](vscode-notebook-cell:?execution_count=99&line=46)
     [44](vscode-notebook-cell:?execution_count=99&line=44) print('sys initial conditions', sys.initial_conditions)
     [45](vscode-notebook-cell:?execution_count=99&line=45) sys.times = np.linspace(0., intervall, int(schritte*intervall))
---> [46](vscode-notebook-cell:?execution_count=99&line=46) sys.generate_ode_function(generator='cython', verbose=True)
     [47](vscode-notebook-cell:?execution_count=99&line=47) resultat = sys.integrate()
     [48](vscode-notebook-cell:?execution_count=99&line=48) print('shape of result', resultat.shape)

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\pydy\system.py:481](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/system.py:481), in System.generate_ode_function(self, **kwargs)
    [477](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/system.py:477)     print("User supplied 'specifieds' kwarg was disregarded.")
    [479](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/system.py:479) kwargs.update(self._kwargs_for_gen_ode_func())
--> [481](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/system.py:481) self._evaluate_ode_function = generate_ode_function(
    [482](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/system.py:482)     *self._args_for_gen_ode_func(),
    [483](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/system.py:483)     **kwargs)
    [485](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/system.py:485) return self.evaluate_ode_function

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\pydy\codegen\ode_function_generators.py:917](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:917), in generate_ode_function(*args, **kwargs)
    [915](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:915)         raise NotImplementedError(msg)
    [916](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:916)     else:
--> [917](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:917)         return g.generate()
    [918](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:918) else:
    [919](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:919)     return g.generate()

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\pydy\codegen\ode_function_generators.py:622](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:622), in ODEFunctionGenerator.generate(self)
    [620](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:620)     self.generate_full_rhs_function()
    [621](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:621) elif self.system_type == 'full mass matrix':
--> [622](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:622)     self.generate_full_mass_matrix_function()
    [623](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:623) elif self.system_type == 'min mass matrix':
    [624](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:624)     self.generate_min_mass_matrix_function()

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\pydy\codegen\ode_function_generators.py:700](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:700), in CythonODEFunctionGenerator.generate_full_mass_matrix_function(self)
    [697](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:697)     self._set_eval_array(self._cythonize_symbolic_lusolve(outputs,
    [698](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:698)                                                           self.inputs))
    [699](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:699) else:
--> [700](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:700)     self._set_eval_array(self._cythonize(outputs, self.inputs))

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\pydy\codegen\ode_function_generators.py:654](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:654), in CythonODEFunctionGenerator._cythonize(self, outputs, inputs)
    [650](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:650) def _cythonize(self, outputs, inputs):
    [651](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:651)     g = CythonMatrixGenerator(inputs, outputs,
    [652](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:652)                               prefix=self._options['prefix'],
    [653](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:653)                               cse=self._options['cse'])
--> [654](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:654)     return g.compile(tmp_dir=self._options['tmp_dir'],
    [655](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/ode_function_generators.py:655)                      verbose=self._options['verbose'])

File [c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\pydy\codegen\cython_code.py:227](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:227), in CythonMatrixGenerator.compile(self, tmp_dir, verbose)
    [225](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:225)     cython_module = importlib.import_module(self.prefix)
    [226](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:226) except:
--> [227](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:227)     raise Exception('Failed to compile and import Cython module.')
    [228](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:228) finally:
    [229](file:///C:/Users/Peter/anaconda3/envs/sympy-dev/Lib/site-packages/pydy/codegen/cython_code.py:229)     sys.path.remove(codedir)

Exception: Failed to compile and import Cython module.
Peter230655 commented 1 month ago

This has been solved, thanks to all who helped!