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

Fail to import pymatgen after master branch install #1223

Closed
skk74 opened this issue Jul 30, 2018 · 6 comments
Closed

Fail to import pymatgen after master branch install #1223

skk74 opened this issue Jul 30, 2018 · 6 comments

Comments

@skk74
Copy link

skk74 commented Jul 30, 2018

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

System

  • Pymatgen version:
  • Python version: <Only 2.7.* and 3.* supported.>
  • OS version: <Ubuntu 16.04>

Summary

  • 1-2 short bullet points stating the problem.
    After running python setup.py install, I attempt to import pymatgen and it seems that pymatgen cannot import the coord_cython module. Is there a dependency that I am missing?

Example code

# Example code generating error

Error message

----> 1 import pymatgen

/home/sanjeev/pymatgen/pymatgen/init.py in ()
54 # Allows from pymatgen import for quick usage.
55
---> 56 from pymatgen.core import *
57 from .electronic_structure.core import Spin, Orbital
58 from .ext.matproj import MPRester

/home/sanjeev/pymatgen/pymatgen/core/init.py in ()
7 from .periodic_table import Element, Specie, DummySpecie
8 from .composition import Composition
----> 9 from .structure import Structure, IStructure, Molecule, IMolecule
10 from .lattice import Lattice
11 from .sites import Site, PeriodicSite

/home/sanjeev/pymatgen/pymatgen/core/structure.py in ()
28
29 from pymatgen.core.operations import SymmOp
---> 30 from pymatgen.core.lattice import Lattice
31 from pymatgen.core.periodic_table import Element, Specie, get_el_sp, DummySpecie
32 from monty.json import MSONable

/home/sanjeev/pymatgen/pymatgen/core/lattice.py in ()
14
15 from monty.json import MSONable
---> 16 from pymatgen.util.coord import pbc_shortest_vectors
17 from pymatgen.util.num import abs_cap
18

/home/sanjeev/pymatgen/pymatgen/util/coord.py in ()
9 import numpy as np
10 import math
---> 11 from . import coord_cython as cuc
12
13 """

ImportError: cannot import name coord_cython

# Error message

Suggested solution (if any)

  • If you have a suggestion on how to solve the issue, you may write it
    here.

Files (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>
@shyuep
Copy link
Member

shyuep commented Jul 30, 2018

Why not use pip install?

@skk74
Copy link
Author

skk74 commented Jul 31, 2018

I would like to use the new part of analysis particularly local_env and it doesn't seem to be available on the pip install version.

@mkhorton
Copy link
Member

local_env is available on the pip installed version, try pip install pymatgen --upgrade ? We recommend using Python 3+ also since Python 2.x support is being dropped, so check what version of pip you're using.

@xivh
Copy link
Contributor

xivh commented Jun 13, 2022

I got the same error and fixed it with CC=gcc python setup.py develop.

@shyuep
Copy link
Member

shyuep commented Jun 13, 2022

@xivh I need a more detailed outline of the exact procedure that you did and error message for us to debug. This is an extremely old issue. We have not heard of anyone having this issue in the past four years.

@xivh
Copy link
Contributor

xivh commented Jun 13, 2022

I got the same import error as Sanjeev when installing from master and importing pymatgen.io.vasp.inputs from inside the pymatgen directory. Running CC=gcc python setup.py develop got rid of the error.

But, I just found out that everything works fine if I leave the directory before importing.

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

4 participants