-
Notifications
You must be signed in to change notification settings - Fork 875
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
Cannot install pymatgen==2019.7.2 with python3.6 #2010
Comments
I think this was a problem with past versions. Try the newest version of pymatgen instead. (Or if that fails, you should use a py37 environment. Py36 is pretty old and a lot of packages already dropped support for it) |
Yes, to expand a little here, |
Hi! I would appreciate if you could re-open the issue as the underlying bug breaks installation flows for all packages that depend on pymatgen, but still support Python 3.6. Concretely, this issue is currently causing a break of our standard installation path for AiiDA, see issue aiidateam/aiida-core#4614 and related pull request aiidateam/aiida-core#4615 . Important to mention that this issue has occurred in the past before, and was previously reported in #1520 . I understand that the pymatgen maintainer perspective is to simply recommend the use of a newer Python version, but this is unfortunately not possible for some users and packages that have long-term support schedules. But even if that was an acceptable solution, this bug would still cause an issue, because it causes all constraints that dependent packages have placed on their numpy dependency to be ignored. This problem would be much less severe if at least older versions of pymatgen would still behave properly, but the root cause makes it basically impossible to have any pymatgen dependency, because -- as was demonstrated by the OP -- even older versions of pymatgen will break. To put it plainly: unless the build setup is fixed, pymatgen will always cause issues when numpy drops support for older Python versions even for older versions of pymatgen, making it basically impossible to declare pymatgen as a dependency without giving up all control over numpy constraints. |
@csadorf I am unclear what is needed from pymatgen side. Certainly older versions of pymatgen will work for python 3.6. We do not specify a numpy version in the setup.py beyond ">=1.14.x". That means even relatively ancient numpy versions should work. The requirements.txt pinning for older versions of pymatgen are based on the numpy versions at those times and is in line with python best practices. I did a test and even as recent as pymatgen 2020.8.3, install on py36 works.
gives me
So it does seem the numpy setup.py is respected. I also tried it with your pymatgen==2019.7.2 and it works as well. In short, I have no idea why your install is failing. I suspect it si an issue with your test-env caching. I suggest you use a clean environment and re-test. Now, that said, you will have to pin to an older version of pymatgen. It seems anything before Sep 2020 should work fine. But newer features will not be available. Unfortunately, we cannot keep retaining compatibility with old versions. Once major packages such as numpy move on, newer versions of pymatgen will have to move on. |
Thanks for taking the time to investigate this @shyuep . The problem seems to be when installing
Now what is remarkable is the conditional which is included in the last line I have been trying to reproduce this on my own machine which also runs Ubuntu 18.04, but without success. There, even in a clean Python 3.6 virtual environment, the |
@sphuber I just retried on a Ubuntu server the exact same series of commands (the previous test was done on a Mac). There is still no error and if a numpy > 1.14 was installed, pymatgen installs without error. This was done on both a supercomputer as well as a virtual machine. So in short, I cannot reproduce the error you mention. I suspect it is something percuilar to the CI environment. |
@shyuep did you |
Note that if we pre-install a version of |
@mkhorton we experienced the same problem over a year ago when Python 2.7 and 3.5 support was dropped by |
Interesting. Then I think this is an issue at either the versioning end or pip end. Basically, pip install should choose the latest version of numpy compatible with that python version (3.6 in your case). It is strange that it is attempting to install 1.20 which is clearly incompatible with py36. |
I think that is exactly where the crux of the problem lies: if I understand things correctly it is not If we look again at the failing build, it is the following command that fails:
I have no idea who calls this command, but it seems likely that |
More evidence that Line 111 in bb6ca9e
I tried to update |
@sphuber I tried doing this from scratch in a clean ubuntu env and a clean conda, i.e., no numpy installed. I even let the system auto-find the correct version of pymatgen. I still cannot reproduce this error. This is the output.
The bottom line is that it is successfully installed and numpy 1.19.4 (which is compatible with py36) was automatically installed. One other thing you might want to look into is whether any existing packages in your env might be causing problems. Usually it is best to have the virtual env be isolated and not use any site-packages. |
@sphuber Thanks. Ok. I will make setuptools>=50 as the requirement. That should fix some of this for now. In general though, I think these things typically are updated by themselves.... |
We do use virtual environments. This is what we recommend to all users for installation and is definitely what we use in our CI. Each run gets a completely new and clean virtual environment. As described above, I really think it is due to the outdated version of |
@sphuber Ok. I have increased the min setuptools version. That will not fix the old pymatgen releases, but hopefully it will prevent future releases from having issues. |
@shyuep Thank you very much for the help and sorry that I was not able to respond earlier. But I'm glad that @sphuber was available to clear up some of the questions. It seems that it is mostly figured out that Here is a minimal example that demonstrates that the bug was apparently resolved in setuptools version 42:
Same behavior when installed as dependency (example with aiida-core):
I therefore assume that it might be related to this change: https://setuptools.readthedocs.io/en/latest/history.html#id170 |
Sorry to add to a long thread, but while some of the issues may have been fixed, one root problem remains unaddressed: pymatgen is using the The solution is to follow PEP-518 and use the [1] To take a recent example, our builds of the AiiDA documentation on readthedocs (using python 3.8) have been broken since December 4th due to an issue with |
Describe the bug
Cannot install pymatgen==2019.7.2 on ubuntu 16.04 in a clean virtualenv with python3.6.11.
To Reproduce
Desktop:
Additional context
It seems it tries to download
numpy-1.20.0rc1
which requires python >= 3.7. I also tried installing a lower version ofnumpy
(1.15.1) and then installingpymatgen
but it didn't work as well.The text was updated successfully, but these errors were encountered: