eitcom / pyEIT

Python based toolkit for Electrical Impedance Tomography
Other
169 stars 96 forks source link

Invalid Synthax error in library #65

Closed rmib200 closed 1 year ago

rmib200 commented 1 year ago

Hi, I've been trying to learn to use my SpectraEIT. I've installed the pyeit lib and was looking at the examples but I run into this invalid synthax error constantly. image Other similar erros I've found are in from pyeit.eit.interp2d import sim2pts with:

  File "/usr/local/lib/python3.7/dist-packages/pyeit/eit/base.py", line 13, in <module>
    from pyeit.eit.protocol import PyEITProtocol

  File "<fstring>", line 1
    (ex_mat=)

The version I am using is pyeit = 1.2.2

Is there a way to fix it? Or other version I should use? I really want to use this for my project with the SpectraEIT.

liubenyuan commented 1 year ago

What's the your python version and package environment? If you are using spectra, you may use the version it specified in their GUI.

ChabaneAmaury commented 1 year ago

Have you tried running it on a local computer with a proper anaconda env ? It could be related to Google Colab itself for some reasons.

Also, could you provide an access to (or at least part of) the notebook so we can recreate this issue?

cancelliere commented 1 year ago

There is no minimum Python version specified in the environment.yml file , but the cause of the issue is due to a feature that has been introduced in Python 3.8, namely the f-string syntax with a trailing = sign. Look for bpo-36817 here. I had Python 3.7 installed and had to update to make it work.

Hope it helps!