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

Can't install on Python 3.11 #2849

Closed
adosar opened this issue Feb 19, 2023 · 14 comments
Closed

Can't install on Python 3.11 #2849

adosar opened this issue Feb 19, 2023 · 14 comments
Labels
install Installation issues linux Linux-specific issues

Comments

@adosar
Copy link

adosar commented Feb 19, 2023

I am trying to install pymatgen on a clear virtual environment on Fedora 37.
python -m venv <virtual-environment-name>
source <virtual-environment-name>
pip install wheel
pip install pymatgen

But I get the error shown on the attached image.
Screenshot from 2023-02-19 15-42-18

@shyuep
Copy link
Member

shyuep commented Feb 19, 2023

3.11 is not officially supported at the moment as it is a bit new. We are working on it.

@janosh
Copy link
Member

janosh commented Feb 19, 2023

Related issue #2710 and PR #2714

@adosar
Copy link
Author

adosar commented Feb 19, 2023

Thanks for the information. I would like to add that the same problem was also present on my laptop which runs Fedora 36 (python 3.10). So, I am guessing that it will be first fixed for 3.10 and then for 3.11?

@ml-evs
Copy link
Contributor

ml-evs commented Feb 22, 2023

Thanks for the information. I would like to add that the same problem was also present on my laptop which runs Fedora 36 (python 3.10). So, I am guessing that it will be first fixed for 3.10 and then for 3.11?

@adosar in your specific case, it looks like you are using your system Python (i.e., one that comes from Fedora itself) to construct your virtual environment. To get around this issue, you need to install the development version of the Python package for Fedora, with something like yum install python-dev.

This will then allow pip to compile the C-extensions that come with pymatgen (see below that we can also ask that these builds get made in the CI of this package, so that everyone on Linux can just install them without recompiling -- I've had no trouble building these wheels myself of pymatgen for Python 3.11 but as @shyuep suggests there maybe outstanding compatibility issues that I haven't run into).

Another option would be to decouple your "science Python" from your system Python by using tools like conda, pyenv etc. to manage separate Python executables for each virtual environment -- people have many opinions on this and the "best tool" changes year on year, so just treat this as something you could consider investigating...


This has made me notice that currently wheels are not being built for Linux on release. Is this intentional (@shyuep @janosh)?

os: [macos-latest, windows-latest]

@janosh
Copy link
Member

janosh commented Feb 22, 2023

currently wheels are not being built for Linux on release

@ml-evs I noticed this as well but don't know the reason. I assume it's just lack of time to implement. There's an open PR for linux wheels #2800.

@ml-evs
Copy link
Contributor

ml-evs commented Feb 22, 2023

I would've thought that simply adding ubuntu-latest to the build matrix line would get you most of the way (that's how I build wheels at least -- understand there must be additional complexities here). It looks like this is what used to be done, until f4959c1

@adosar
Copy link
Author

adosar commented Feb 22, 2023

For Fedora users:
(Fedora 36 here but of course can work with newer releases)
sudo dnf install python3.9
python3.9 -m venv <venv-name>
source <venv-name>
pip install wheel
pip install pymatgen

Installation had no problems.

@janosh
Copy link
Member

janosh commented Feb 23, 2023

@ml-evs Ah, looks like because of the compiled C extensions in pymatgen, uploading a Linux wheel isn't straightforward and needs to go through manylinux like #2800 is attempting.

@adosar
Copy link
Author

adosar commented Mar 7, 2023

Now pymatgen can be easily installed on python3.10 with pip (works flawlessly in Fedora 36).

@shyuep
Copy link
Member

shyuep commented Mar 7, 2023

Great. Thanks,

@shyuep shyuep closed this as completed Mar 7, 2023
@adosar
Copy link
Author

adosar commented Mar 7, 2023

Great. Thanks,

@shyuep Haven't tried it yet to python3.11 though. Can you please leave it open untill it works also on python3.11? Thanks!

@shyuep shyuep reopened this Mar 7, 2023
@shyuep
Copy link
Member

shyuep commented Mar 7, 2023

Sure.

@adosar
Copy link
Author

adosar commented Mar 28, 2023

I have tried it also in Fedora 37 with Python 3.11.2 and works flawlessly. Just pip install pymatgen.

@janosh
Copy link
Member

janosh commented May 19, 2023

@adosar Thanks for confirming.

@janosh janosh closed this as completed May 19, 2023
@janosh janosh added install Installation issues linux Linux-specific issues labels May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
install Installation issues linux Linux-specific issues
Projects
None yet
Development

No branches or pull requests

4 participants