Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struggling with pydantic-related architecture mismatch #93

Open
vmgaribay opened this issue Jul 16, 2024 · 4 comments
Open

Struggling with pydantic-related architecture mismatch #93

vmgaribay opened this issue Jul 16, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@vmgaribay
Copy link

I am not sure if this is because I installed pydantic as an afterthought or what, but I am getting an import error (featured below) relating to the architecture (probably a Mac thing?).
I am confident that I will find a work around once I understand how to fix it, but I would hate for this to be the reason that people cannot use the software; so, if there is any way to ensure maximum compatibility by instructing users to follow a certain series of steps, we should make a note of that in our documentation.

ImportError: dlopen(/opt/homebrew/lib/python3.10/site-packages/pydantic_core/_pydantic_core.cpython-310-darwin.so, 0x0002): tried: '/opt/homebrew/lib/python3.10/site-packages/pydantic_core/_pydantic_core.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/python3.10/site-packages/pydantic_core/_pydantic_core.cpython-310-darwin.so' (no such file), '/opt/homebrew/lib/python3.10/site-packages/pydantic_core/_pydantic_core.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

@vmgaribay
Copy link
Author

vmgaribay commented Jul 16, 2024

I was able to do it after intense googling. I hope I didn't mess anything else up for myself. I did all this in my virtual environment, but I felt like the clueless dog meme
Not sure if it is worth generalizing, but the architecture of my homebrew was wrong (I think?) I uninstalled/reinstalled it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
and python:
arch -arm64 brew install python
and pydantic:
pip install pydantic

TL;DR: All fixed, not sure if it is worth any extra trouble,

staying open for now, but feel free to close if it's not worth it.

@vmgaribay
Copy link
Author

In a related note, it may be nice to outline the proper procedure for adding a variable

@SarahAlidoost
Copy link

I was able to do it after intense googling. I hope I didn't mess anything else up for myself. I did all this in my virtual environment, but I felt like the clueless dog meme Not sure if it is worth generalizing, but the architecture of my homebrew was wrong (I think?) I uninstalled/reinstalled it: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" and python: arch -arm64 brew install python and pydantic: pip install pydantic

TL;DR: All fixed, not sure if it is worth any extra trouble,

staying open for now, but feel free to close if it's not worth it.

Thanks for reporting this and great that you could fix the issue on your system 👍 . We found that different operating systems, architectures, and related Python libraries can cause compatibility issues with DGL (see discussions here, though not with Pydantic. 🤔

Currently, there are GitHub Actions set up in this repository to check the dgl_ptm package's functionality on macOS ARM64, macOS x86_64, Linux, and Windows. The action workflows are defined here and here for macOS x86_64.
When we submit a pull request to merge our code into the development or main branch, these actions will run automatically to ensure the changes are safe to merge. For example, see the actions for the development branch. 😊

@SarahAlidoost
Copy link

SarahAlidoost commented Aug 2, 2024

In a related note, it may be nice to outline the proper procedure for adding a variable

Do you mean adding a variable to config.py? The config.py uses Pydantic, see an example in its documentation. The config.py uses a simple structure like variable_name: type_of_the_variable = default value, for example, new_node_edges: int = 1 or del_method: str = "probability". Pydantic primarily uses Python's built-in types, but also supports customized types.

It would be helpful to include this information in the documentation for example contributing guidelines. I will add label documentation to this issue.

@SarahAlidoost SarahAlidoost added the documentation Improvements or additions to documentation label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants