You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "hammadsaleemm (via GitHub)" <gi...@apache.org> on 2023/05/04 14:21:38 UTC

[GitHub] [age] hammadsaleemm opened a new issue, #890: ImportError in age.models

hammadsaleemm opened a new issue, #890:
URL: https://github.com/apache/age/issues/890

   I encountered an ImportError when trying to import 'Model' from 'age.models' in the age Python driver for Apache AGE. The error message reads:
   
       ImportError: cannot import name 'Model' from 'age.models' (c:\Users\lenovo\age\drivers\python\age\models.py)
   
   I am running Python 3.9 on Windows 10. Here are the steps I took to encounter the error:
   
   1. Installed the age Python driver using pip.
   2. Attempted to import 'Model' from 'age.models'.
   3. Encountered the ImportError.
   
   Please let me know if there is any additional information I can provide to help diagnose and fix this issue.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] AhmedMo0 commented on issue #890: ImportError in age.models

Posted by "AhmedMo0 (via GitHub)" <gi...@apache.org>.
AhmedMo0 commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1546289597

   if you checked [models.py](https://github.com/rhizome-ai/apache-age-python/blob/main/age/models.py) file you will not find Model 
   class So, check import statement is written correctly


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] humzakt commented on issue #890: ImportError in age.models

Posted by "humzakt (via GitHub)" <gi...@apache.org>.
humzakt commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1535172521

   Models isn't defined in `models.py`. You can check https://github.com/rhizome-ai/apache-age-python/blob/main/age/models.py for all available classes which you can import


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] waleedahmed0001 commented on issue #890: ImportError in age.models

Posted by "waleedahmed0001 (via GitHub)" <gi...@apache.org>.
waleedahmed0001 commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1605485768

   These are the classes defined in the models file.
   
   Graph: Represents a graph object with rows and vertices.
   AGObj: Base class for AGE objects.
   Path: Represents a path object composed of multiple entities.
   Vertex: Represents a vertex in the graph with an ID, label, and properties.
   Edge: Represents an edge in the graph with an ID, label, start ID, end ID, and properties.
   
   The model class is not defined and that's why you are getting this error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] AadilBashir489 commented on issue #890: ImportError in age.models

Posted by "AadilBashir489 (via GitHub)" <gi...@apache.org>.
AadilBashir489 commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1597842711

   In `age.models`, there exist no class named 'Model', which is why you are facing this error. The solution is to correct your import statement like this below:
   `from age.models import *`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] AadilBashir489 commented on issue #890: ImportError in age.models

Posted by "AadilBashir489 (via GitHub)" <gi...@apache.org>.
AadilBashir489 commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1725486998

   There is no class named `Model` in `models.py` but you can import other classes from this library by uisng this below statement.
   `from age.models import *`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] ImportError in age.models [age]

Posted by "pawankukreja01 (via GitHub)" <gi...@apache.org>.
pawankukreja01 commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1763488374

   **Check for circular imports**: Circular imports can cause issues with importing modules in Python. Ensure that there are no circular imports between your modules.
   **Check for version compatibility issues**: Ensure that you are using a compatible version of Apache AGE with your version of Python.
   **Check that the module exists**: Verify that the ‘age.models’ module exists in the correct location and contains the ‘Model’ class. You can do this by opening a Python shell and running `import age.models` followed by `dir(age.models)` to see a list of all objects in the module.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] safi50 commented on issue #890: ImportError in age.models

Posted by "safi50 (via GitHub)" <gi...@apache.org>.
safi50 commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1535730084

   If you open the `models.py` file in the python driver, you'll find that there is no `Model` class or `Function`. 
   If you are simply trying to import the file `age.models`, use the import statements as : 
   ` import age.models as model`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Omar-Saad commented on issue #890: ImportError in age.models

Posted by "Omar-Saad (via GitHub)" <gi...@apache.org>.
Omar-Saad commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1603307387

   There is no `Model` class present in the `models.py` file, which is why you are encountering this error. To import all the classes from this file, you can utilize the following code:
   
   ```python
   from age.models import *
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] mahinash26 commented on issue #890: ImportError in age.models

Posted by "mahinash26 (via GitHub)" <gi...@apache.org>.
mahinash26 commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1602822878

   The ImportError is occurring because you are attempting to import a 'Model' class that is not present in the age.models module. Double-check that you are importing a valid class or function from the age.models module.
   I hope this helps.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] M4rcxs commented on issue #890: ImportError in age.models

Posted by "M4rcxs (via GitHub)" <gi...@apache.org>.
M4rcxs commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1540942028

   It looks like the 'Model' class is not defined in the `age.models` module. This could be the reason why you are getting the ImportError when trying to import it. Alternatively, you can try reviewing your import statement to make sure that you are using the correct class name or function name. 
   reach it on: [Age Models](https://github.com/rhizome-ai/apache-age-python/blob/main/age/models.py)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] dukeofhazardz commented on issue #890: ImportError in age.models

Posted by "dukeofhazardz (via GitHub)" <gi...@apache.org>.
dukeofhazardz commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1536399065

   You could try importing all;
   `from age.models import *`
   Or
   `from age.models import Graph, Edge, Vertex`
   Referencing the particular class you'd like to use 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] vkt-1271 commented on issue #890: ImportError in age.models

Posted by "vkt-1271 (via GitHub)" <gi...@apache.org>.
vkt-1271 commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1642698668

   You're importing a class that doesn't exist in `models.py` that's why you facing this error.
   Try using: `from age.models import *`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] aru-d-at commented on issue #890: ImportError in age.models

Posted by "aru-d-at (via GitHub)" <gi...@apache.org>.
aru-d-at commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1535178271

   @hammadsaleemm 
   > Attempted to import 'Model' from 'age.models'.
   
   You should be importing one or more of the classes defined.
   
   [Refer to the test file](https://github.com/apache/age/blob/master/drivers/python/test_age_py.py) for usage of the models.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] titoausten commented on issue #890: ImportError in age.models

Posted by "titoausten (via GitHub)" <gi...@apache.org>.
titoausten commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1534964316

   Model isn't a `Class` or `function` under `age.model`.
   Instead you can `from age.models import *`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Nimra-1234 commented on issue #890: ImportError in age.models

Posted by "Nimra-1234 (via GitHub)" <gi...@apache.org>.
Nimra-1234 commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1567940754

   The 'Model' class does not appear to be declared in the `age.models `module. This could be the cause of the ImportError while attempting to import it. Alternatively, check your import statement to ensure that you are using the correct class or function name.
   
   Import using:
   `from age.models import *`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] abdulmanann commented on issue #890: ImportError in age.models

Posted by "abdulmanann (via GitHub)" <gi...@apache.org>.
abdulmanann commented on issue #890:
URL: https://github.com/apache/age/issues/890#issuecomment-1568356002

   It appears that the ImportError is caused by trying to import a 'Model' class that doesn't exist in the `age.models` module. 
   
   If you check the content of `age.models` on the [Apache AGE Python driver GitHub page](https://github.com/rhizome-ai/apache-age-python/blob/main/age/models.py), you will see that 'Model' is not a declared class in that module, which is why you're encountering this error.
   
   Please make sure you are importing a class or function that actually exists in the `age.models` module. You can import all classes from `age.models` with the following statement:
   
   ```python
   from age.models import *
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org