How to install pymatgen for Python 2.7.x and not 3.6

1.3k Views Asked by At

The pymatgen module is supposed to work for Python 2.7.x or 3. Files for both are available (https://anaconda.org/matsci/pymatgen/files). My Python (sys.version) is 2.7.11.

I tried installing with standard: "conda install -c mastic pymatgen", but it returns an error:

"Fetching package metadata ...........                                                                       
Solving package specifications: .                                                                           

UnsatisfiableError: The following specifications were found to be in conflict:                              
  - pymatgen -> python 3.6*                                                                                 
  - python 3.5*                                                                                             
Use "conda info <package>" to see the dependencies for each package."

It looks like it is trying to install the pymatgen module for Python 3 and I am a version short.

I want to install the 2.7.x compatible version, but can't find instructions on how to force the conda install to do that.

I can't upgrade to 3.6 for other reasons.

3

There are 3 best solutions below

1
Emad M On

Have you tried pip ?

But first install NumPy as they mentioned Here

then use : pip install pymatgen

0
Gemechis Degaga On

Restarted from running Miniconda3-latest-MacOSX-x86_64.sh, instead of Miniconda2-latest-MacOSX-x86_64.sh.

0
Shyue Ping Ong On

Whatever conda you installed, you can create a specific Python 2.7 environment using

conda create --name py27 python=2.7

You should then be able to follow all the steps for Python 2.7 install.