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

Problems encountered with dependencies and versions during Installation #4

Open
Joey-Tai opened this issue Dec 24, 2024 · 8 comments
Open

Comments

@Joey-Tai
Copy link

Dear Authors,

I hope this message finds you well. I am currently attempting to integrate the DifFlexMM project into my development environment within PyCharm, but I have encountered a series of challenges that I believe may require your expertise.

Upon following the installation commands provided in the README file, it appears that the dependencies are being installed at their latest versions. However, certain functions within the project are reliant on older versions of these dependencies. As a result, despite a successful installation, I am encountering errors such as:

from jax.abstract_arrays import ShapedArray
ModuleNotFoundError: No module named 'jax.abstract_arrays'

In an effort to resolve these issues, I attempted to manually install the dependencies as listed in the pyproject.toml file. Unfortunately, I found that the list is not comprehensive, and there are conflicts among some of the dependencies, notably with older versions of jax, chex, optax, and others.

I am seeking guidance on how to correctly install the specific versions of dependencies that are compatible with this project. Your assistance in this matter would be greatly appreciated.

Thank you in advance for your time and support.

Best Regards

@GiovanniBordiga
Copy link
Member

Hello @Joey-Tai !

Thank you for reaching out! As noted in the README, the package dependencies have been tested and verified with Python 3.8 and 3.9. I am also running a local version with Python 3.10 and can confirm that all dependencies install successfully in this environment as well.

If you're encountering any issues, please double-check your Python version and ensure it matches one of the supported versions. If the problem persists, feel free to provide additional details, and I’ll do my best to assist you further.

Best

@Joey-Tai Joey-Tai closed this as not planned Won't fix, can't repro, duplicate, stale Dec 30, 2024
@Joey-Tai
Copy link
Author

Thank you for your prompt response and for clarifying the supported Python versions! I have taken your advice and ensured that I am using Python 3.9.21 within an Anaconda environment.
Despite a successful installation of all dependencies, I encountered an error when attempting to execute the program, specifically when utilizing the setup_dynamic_solver function. The error message I received was:
AttributeError: module 'jax.random' has no attribute 'KeyArray'
Upon further investigation, I discovered that jax.random.KeyArray has been deprecated since JAX version 4.2.24. It appears that during the installation of DifFlexMM, JAX version 4.2.30 was automatically installed, which may be the source of the issue. The issue I posted that mentioned the missing of jax.abstract_arrays may have a same reason.
I have also made attempts to manually install the dependencies using pip, one by one. However, I found that many of the dependencies are interrelated, and installing one often triggers updates to related dependencies. This interdependence has made it challenging to install the exact versions required without inadvertently updating others.
I would greatly appreciate any guidance you could provide on how to resolve this version conflict and successfully run the project with the correct dependency versions.
Thank you once again for your assistance, and I look forward to your reply.
Best regards

@Joey-Tai Joey-Tai reopened this Dec 30, 2024
@GiovanniBordiga
Copy link
Member

You are using poetry, right?

@Joey-Tai
Copy link
Author

I don't think I'm using poetry. I followed this in the readme file:

'Assuming you have access to the repo and ssh keys are set up in your GitHub account, you can install the package with
pip install git+ssh://git@github.com/bertoldi-collab/DifFlexMM.git'

to install dependencies in the terminal of anaconda virtual environment.

@GiovanniBordiga
Copy link
Member

GiovanniBordiga commented Jan 2, 2025

I don't think I'm using poetry. I followed this in the readme file:

'Assuming you have access to the repo and ssh keys are set up in your GitHub account, you can install the package with pip install git+ssh://git@github.com/bertoldi-collab/DifFlexMM.git'

to install dependencies in the terminal of anaconda virtual environment.

I do not use Anaconda so I am not sure I can be helpful there.

Something else to be aware of is that pip does not resolve dependencies properly in some situations.
I would suggest you try using poetry, which in my experience has always resolved dependencies correctly. You can find instructions in the README. 🤞

@Joey-Tai
Copy link
Author

Joey-Tai commented Jan 3, 2025

Thanks a lot! Poetry works a lot better!
After installing with poetry, most of the dependencies are of correct version. Only a small problem persists:

  • Installing jaxlib (0.4.7): Failed

RuntimeError

Unable to find installation candidates for jaxlib (0.4.7)

at D:\Anaconda\envs\env39withpoetry\lib\site-packages\poetry\installation\chooser.py:74 in choose_for
70│
71│ links.append(link)
72│
73│ if not links:
→ 74│ raise RuntimeError(f"Unable to find installation candidates for {package}")
75│
76│ # Get the best link
77│ chosen = max(links, key=lambda link: self._sort_key(package, link))
78│

Cannot install jaxlib.

It seems jaxlib 0.4.7 cannot be fetched.
I have checked the available resources and documentation, but I am still unable to resolve this issue.

Thank you once again for your support!

@GiovanniBordiga
Copy link
Member

I just tested the poetry installation on Python 3.9.20 (Unfortunately I cannot test 3.9.21 on my system as not provided by pyenv) and everything gets installed properly.
I think Anaconda might be your issue.

What's your system/OS?

@Joey-Tai
Copy link
Author

Joey-Tai commented Jan 3, 2025

Windows11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants