Closed ManuelZ closed 2 years ago
Did you change Examples\geneticOptimizationSliderCrank.py ? on my installation it runs. I would need more information on Python version, etc. do you use "from exudyn import *" ? you should not use that. This may be the reason. In fact, one could omit the signal module, as it is mostly not needed. If it makes problems, I will rename that in future. In my case, it is imported as exu.signal, which does not cause any problems.
I didn't modify Examples\geneticOptimizationSliderCrank.py
.
The geneticOptimizationSliderCrank.py
example has these imports
from exudyn.itemInterface import *
from exudyn.utilities import *
But no from exudyn import *
.
My system:
>>> import platform; print(platform.platform())
Windows-10-10.0.19041-SP0
>>> import sys; print("Python", sys.version)
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)]
>>> import exudyn
>>> exudyn.__version__
'1.1.42'
>>> import matplotlib
>>> matplotlib.__version__
'3.5.1'
I'm not really using the signal module, I just was running through that examples and found out that error.
This is due to Python 3.8.8. The command python.exe exudyn\resultsMonitor.py Examples\solution\geneticSliderCrank.txt from runs fine from command line with Python 3.8.5.
However, I get the same error in Python 3.9.7. The resultsMonitor.py is not included in the TestSuite. However, if you have a older Python 3.6 or 3.7 installed in parallel to Python 3.8.8, you could install exudyn there and use this Python to view your results as is does not have to be the same Python version ...
exudyn.signal will be removed in next version of exudyn
NOTE: In your description, you were missing "Examples\" in your path.
exudyn.signal.py has now been renamed to exudyn.signalProcessing.py This should resolve this issue.
I'm getting the following error when running the
resultsMonitor.py
script:To reproduce:
Change directory into
pythonDev
:Run the genetic optimizer:
In another tab run the
resultsMonitor.py
script:I think this may be due to the clash between the built-in signal package which does have the
getsignal
function and the Exudyn file calledsignal.py
, which causes Matplotlib to find the Exudyn's signal package instead of the Python's one.