oeg-upm / yatter

Translate YARRRML into easy-to-read [R2]RML mappings

Home Page:https://doi.org/10.5281/zenodo.7024500

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: partially initialized module 'yarrrml_translator' has no attribute 'translate' (most likely due to a circular import)

shakeel26 opened this issue · comments

Command line version is working fine but when I want to include the module in your implementation where I am just using the simple example:

import yarrrml_translator
import yaml
rml_content = yarrrml_translator.translate(yaml.safe_load(open("yarrml.yml")))
print(rml_content)

Here is the error:
AttributeError: partially initialized module 'yarrrml_translator' has no attribute 'translate' (most likely due to a circular import)
Screenshot from 2022-10-25 23-15-38

Can you please check ?

I run this in a google collab notebook and it works. I think this is related to #36, and once solved, it will work

Captura de Pantalla 2022-10-26 a las 11 56 47

I have upgraded python3.8 to 3.9 and then on installation
pip install yarrrml-translator
Screenshot from 2022-10-26 17-13-05

Installation works I believe.
but still on running the file with module import I have the above error ```AttributeError: partially initialized module 'yarrrml_translator' has no attribute 'translate' (most likely due to a circular import)

What is reported there is that you already have installed the engine.
My suggestion would be to create a virtual environment and install it, as it seems an error on your imports. You can create requirements.txt with your dependencies and install them as python3 -m pip install -r requirements.txt.
To be honest, I don't think this is a related issue with the engine as it has been tested that it works in google collab.
This and #36 will be closed.