materialsproject / pymatgen

Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
https://pymatgen.org
Other
1.52k stars 867 forks source link

problem installing pymatgen #371

Closed asb130 closed 8 years ago

asb130 commented 8 years ago

<When reporting bugs/issues, please supply the following information. If this is a feature request, please simply state the requested feature.>

System

I am getting the following error while installing pymatgen when I type python pmg_install.py in the directory where I have .py script. I get this error. Detected Python version 2.7.2.final.0 Detected setuptools version 5.4.1 Traceback (most recent call last): File "pmg_install.py", line 125, in print("Detected pip version {}".format(pip.version)) AttributeError: 'module' object has no attribute 'version'

Example code

<Example code generating error>

Error message

Detected Python version 2.7.2.final.0 Detected setuptools version 5.4.1 Traceback (most recent call last): File "pmg_install.py", line 125, in print("Detected pip version {}".format(pip.version)) AttributeError: 'module' object has no attribute 'version'

<Error message>

Suggested solution (if any)

<If input files are needed to reproduce the error, please provide either links (e.g., Dropbox or GDrive) for large files or simply paste the file below for small files.>

<contents of file 1>

Ashish Bhatnagar
shyuep commented 8 years ago

This seems to be an old version of the script. The new version should use version for pip. In any case, you can easily install pymatgen just using pip install pymatgen nowadays. There is no need to use this script, which was more for old days when some of the dependencies are more difficult to install.

asb130 commented 8 years ago

I am using the version which is currently available at pymatgen website. At the website it is written that "This installation script requires only basic Python 2.7+, setuptools, and a working version of gcc as prerequisites. Click to download the pmg_install.py script. Move the script to an empty directory and then run:

python pmg_install.py"

on using python pmg_install.py, I am getting error written in my last mail. Now on using pip install pymatgen or by using pip install pymatgen --user. I am getting the following error. I am very new to python and linux. Kindly let me know how to install this software.

error: Command "/usr/bin/gfortran -Wall -g -Wall -g -shared build/temp.linux-x86_64-2.7/numpy/linalg/lapack_litemodule.o build/temp.linux-x86_64-2.7/numpy/linalg/lapack_lite/python_xerbla.o -L/usr/local/lib -L/usr/lib64 -L/opt/sam/epd/epd-7.2-2-rh5-x86_64/lib -Lbuild/temp.linux-x86_64-2.7 -llapack -llapack -lblas -lblas -lpython2.7 -lgfortran -o build/lib.linux-x86_64-2.7/numpy/linalg/lapack_lite.so" failed with exit status 1


Rolling back uninstall of numpy Command /opt/sam/epd/epd-7.2-2-rh5-x86_64/bin/python -c "import setuptools;file='/ihome/kjohnson/asb130/pymtagen/build/numpy/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /tmp/pip-PGeswR-record/install-record.txt --user failed with error code 1 Storing complete log in /ihome/kjohnson/asb130/.pip/pip.log

shyuep commented 8 years ago

If you have a linux operating system, it is best you do a sudo apt-get install python-numpy python-scipy first, then just do pip install pymatgen. That should already work without doing anything else.