connorourke / crystal_torture

crystal_torture: A crystal structure analysis code, allowing site tortuosity to be calculated.
MIT License
7 stars 2 forks source link

./build_tort.sh install and f2py3 dependency both unhandled by pip install #1

Closed katyhuff closed 5 years ago

katyhuff commented 5 years ago

Hi Folks, I'm looking at your JOSS submission and I started with readme. The pip install doesn't seem to properly place your build_tort.sh script (with or without sudo). See below for the first error I run into while following the instructions. It looks like f2py3 needs to be included in the pip recipe... my system already has f2py installed... does it need to be aliased to f2py3? I see some related issues in the context of anaconda numpy. Perhaps that's the source of the trouble.

khuff@maria:~/repos/2019-inl-msr-multiphysics $ pip install crystal_torture
Collecting crystal_torture
  Downloading https://files.pythonhosted.org/packages/d6/0d/fd12991f2321cf6725149f647c3e8d6468a69497c3a984bb1d3550984ee3/crystal_torture-1.0.3.tar.gz (6.8MB)
    100% |████████████████████████████████| 6.8MB 3.9MB/s
    Complete output from command python setup.py egg_info:
    Requirement already satisfied: numpy in /Users/khuff/anaconda/lib/python3.5/site-packages (1.11.2)
    You are using pip version 18.1, however version 19.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Collecting ddt (from -r requirements.txt (line 1))
      Downloading https://files.pythonhosted.org/packages/e4/d8/4649ee669e41760d82463057215d93efa899ed0472a05b256b9ff7ba53c2/ddt-1.2.0-py2.py3-none-any.whl
    Collecting coverage (from -r requirements.txt (line 2))
      Downloading https://files.pythonhosted.org/packages/a7/ca/e74aa09f7a636bc5e1a110db24d0120dbbb3838794b3ef8e831ef91c5235/coverage-4.5.2-cp35-cp35m-macosx_10_12_x86_64.whl (180kB)
    Requirement already satisfied: numpy in /Users/khuff/anaconda/lib/python3.5/site-packages (from -r requirements.txt (line 3)) (1.11.2)
    Collecting pymatgen (from -r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/d9/48/274cf556d5525b5398e49e08c70c9f28bdb9b94df8474f5a4e30c986f934/pymatgen-2019.1.24.tar.gz (2.0MB)
    Collecting f90wrap (from -r requirements.txt (line 5))
      Downloading https://files.pythonhosted.org/packages/05/80/80e4f6d3829a583d1bf9fad4735c9c4f7d9e96d0c51737413aeb6b7c07b7/f90wrap-0.1.4.tar.gz (66kB)
    Requirement already satisfied: requests in /Users/khuff/anaconda/lib/python3.5/site-packages (from pymatgen->-r requirements.txt (line 4)) (2.14.2)
    Collecting ruamel.yaml>=0.15.6 (from pymatgen->-r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/2d/25/4fa8fcf09a05e09d8e3dcef26e49fbac724b9b9cda79ef7789187612a76a/ruamel.yaml-0.15.87-cp35-cp35m-macosx_10_6_intel.whl (361kB)
    Collecting monty>=0.9.6 (from pymatgen->-r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/37/32/1766195d89398fa070a5098e462907f31154881d6381746c25b69f1c2fdc/monty-1.0.5-py3-none-any.whl (62kB)
    Collecting scipy>=1.0.1 (from pymatgen->-r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/11/ad/9d71302bfda15523a7cabb35c26eb41b4c6c8412897b34eca809bcaf709f/scipy-1.2.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (28.6MB)
    Collecting pydispatcher>=2.0.5 (from pymatgen->-r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/cd/37/39aca520918ce1935bea9c356bcbb7ed7e52ad4e31bff9b943dfc8e7115b/PyDispatcher-2.0.5.tar.gz
    Collecting tabulate (from pymatgen->-r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/c2/fd/202954b3f0eb896c53b7b6f07390851b1fd2ca84aa95880d7ae4f434c4ac/tabulate-0.8.3.tar.gz (46kB)
    Collecting spglib>=1.9.9.44 (from pymatgen->-r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/81/56/e4a10ea745fd9b39aeb1b0a22ac045fbc1e89f6233836a6b07b27f0295a5/spglib-1.12.0.post3.tar.gz (709kB)
    Collecting networkx>=2.1 (from pymatgen->-r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/f3/f4/7e20ef40b118478191cec0b58c3192f822cace858c19505c7670961b76b2/networkx-2.2.zip (1.7MB)
    Requirement already satisfied: matplotlib>=1.5 in /Users/khuff/anaconda/lib/python3.5/site-packages (from pymatgen->-r requirements.txt (line 4)) (1.5.1)
    Collecting palettable>=2.1.1 (from pymatgen->-r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/56/8a/84537c0354f0d1f03bf644b71bf8e0a50db9c1294181905721a5f3efbf66/palettable-3.1.1-py2.py3-none-any.whl (77kB)
    Requirement already satisfied: sympy in /Users/khuff/anaconda/lib/python3.5/site-packages (from pymatgen->-r requirements.txt (line 4)) (1.0)
    Requirement already satisfied: pandas in /Users/khuff/anaconda/lib/python3.5/site-packages (from pymatgen->-r requirements.txt (line 4)) (0.18.0)
    Requirement already satisfied: six in /Users/khuff/anaconda/lib/python3.5/site-packages (from monty>=0.9.6->pymatgen->-r requirements.txt (line 4)) (1.10.0)
    Collecting decorator>=4.3.0 (from networkx>=2.1->pymatgen->-r requirements.txt (line 4))
      Downloading https://files.pythonhosted.org/packages/f1/cd/7c8240007e9716b14679bc217a1baefa4432aa30394f7e2ec40a52b1a708/decorator-4.3.2-py2.py3-none-any.whl
    Requirement already satisfied: python-dateutil in /Users/khuff/anaconda/lib/python3.5/site-packages (from matplotlib>=1.5->pymatgen->-r requirements.txt (line 4)) (2.5.1)
    Requirement already satisfied: pytz in /Users/khuff/anaconda/lib/python3.5/site-packages (from matplotlib>=1.5->pymatgen->-r requirements.txt (line 4)) (2016.2)
    Requirement already satisfied: cycler in /Users/khuff/anaconda/lib/python3.5/site-packages (from matplotlib>=1.5->pymatgen->-r requirements.txt (line 4)) (0.10.0)
    Requirement already satisfied: pyparsing!=2.0.4,>=1.5.6 in /Users/khuff/anaconda/lib/python3.5/site-packages (from matplotlib>=1.5->pymatgen->-r requirements.txt (line 4)) (2.0.3)
    Building wheels for collected packages: pymatgen, f90wrap, pydispatcher, tabulate, spglib, networkx
      Running setup.py bdist_wheel for pymatgen: started
      Running setup.py bdist_wheel for pymatgen: finished with status 'done'
      Stored in directory: /Users/khuff/Library/Caches/pip/wheels/97/39/e8/29c2f117cda7d7a2163614f057862dabc2c3aa643156499560
      Running setup.py bdist_wheel for f90wrap: started
      Running setup.py bdist_wheel for f90wrap: finished with status 'done'
      Stored in directory: /Users/khuff/Library/Caches/pip/wheels/b6/0d/aa/2cc8afe73a21eb7d5dfdb2678d26ee2c9bfce49574ed02a79e
      Running setup.py bdist_wheel for pydispatcher: started
      Running setup.py bdist_wheel for pydispatcher: finished with status 'done'
      Stored in directory: /Users/khuff/Library/Caches/pip/wheels/88/99/96/cfef6665f9cb1522ee6757ae5955feedf2fe25f1737f91fa7f
      Running setup.py bdist_wheel for tabulate: started
      Running setup.py bdist_wheel for tabulate: finished with status 'done'
      Stored in directory: /Users/khuff/Library/Caches/pip/wheels/2b/67/89/414471314a2d15de625d184d8be6d38a03ae1e983dbda91e84
      Running setup.py bdist_wheel for spglib: started
      Running setup.py bdist_wheel for spglib: finished with status 'done'
      Stored in directory: /Users/khuff/Library/Caches/pip/wheels/66/f1/0e/9e6ba8bc67ce9cfbede041f2da6ed5e38225d1ed900ce85706
      Running setup.py bdist_wheel for networkx: started
      Running setup.py bdist_wheel for networkx: finished with status 'done'
      Stored in directory: /Users/khuff/Library/Caches/pip/wheels/68/f8/29/b53346a112a07d30a5a84d53f19aeadaa1a474897c0423af91
    Successfully built pymatgen f90wrap pydispatcher tabulate spglib networkx
    scikit-image 0.12.3 requires dask[array]>=0.5.0, which is not installed.
    pymatgen 2019.1.24 has requirement numpy>=1.14.3, but you'll have numpy 1.11.2 which is incompatible.
    Installing collected packages: ddt, coverage, ruamel.yaml, monty, scipy, pydispatcher, tabulate, spglib, decorator, networkx, palettable, pymatgen, f90wrap
      Found existing installation: scipy 0.18.1
        Uninstalling scipy-0.18.1:
          Successfully uninstalled scipy-0.18.1
      Found existing installation: decorator 4.0.10
        Uninstalling decorator-4.0.10:
          Successfully uninstalled decorator-4.0.10
      Found existing installation: networkx 1.11
        Uninstalling networkx-1.11:
          Successfully uninstalled networkx-1.11
    Successfully installed coverage-4.5.2 ddt-1.2.0 decorator-4.3.2 f90wrap-0.1.4 monty-1.0.5 networkx-2.2 palettable-3.1.1 pydispatcher-2.0.5 pymatgen-2019.1.24 ruamel.yaml-0.15.87 scipy-1.2.0 spglib-1.12.0.post3 tabulate-0.8.3
    You are using pip version 18.1, however version 19.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    /private/var/folders/6p/tyy6zsdd50vcnw0m1sf5n8040000gn/T/pip-install-_0p7cdri/crystal-torture/crystal_torture
    __init__.py
    __init__.pyc
    __pycache__
    cluster.py
    cluster.pyc
    dist.f90
    f90wrap_tort.f90
    graph.py
    graph.pyc
    minimal_cluster.py
    node.py
    node.pyc
    pymatgen_doping.py
    pymatgen_interface.py
    pymatgen_interface.pyc
    tort.f90
    tort.py
    tort.pyc
    version.py
    /bin/sh: ./build_tort.sh: No such file or directory
    /bin/sh: f2py3: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/6p/tyy6zsdd50vcnw0m1sf5n8040000gn/T/pip-install-_0p7cdri/crystal-torture/setup.py", line 126, in <module>
        args = check_f2py_compiler()
      File "/private/var/folders/6p/tyy6zsdd50vcnw0m1sf5n8040000gn/T/pip-install-_0p7cdri/crystal-torture/setup.py", line 51, in check_f2py_compiler
        result = subprocess.check_output('f2py3 -c --help-fcompiler | grep -A 1 \'Fortran compilers found\' ',shell=True)
      File "/Users/khuff/anaconda/lib/python3.5/subprocess.py", line 626, in check_output
        **kwargs).stdout
      File "/Users/khuff/anaconda/lib/python3.5/subprocess.py", line 708, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command 'f2py3 -c --help-fcompiler | grep -A 1 'Fortran compilers found' ' returned non-zero exit status 1

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/6p/tyy6zsdd50vcnw0m1sf5n8040000gn/T/pip-install-_0p7cdri/crystal-torture/

My pip is perpetually out of date (thus the warning) so I tried installing f2py3 on its own... doesn't seem available. I recommend that you include instructions on installing f2py3 and all other dependencies required before the pip install.

khuff@maria:~ $ pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/46/dc/7fd5df840efb3e56c8b4f768793a237ec4ee59891959d6a215d63f727023/pip-19.0.1-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 14.1MB/s
Installing collected packages: pip
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
Successfully installed pip-19.0.1
khuff@maria:~ $ pip install f2py3
Collecting f2py3
  Could not find a version that satisfies the requirement f2py3 (from versions: )
No matching distribution found for f2py3
khuff@maria:~ $ which f2py
/Users/khuff/anaconda/bin/f2py
khuff@maria:~ $

This issue can be closed when pip install crystal_torture works as indicated in the readme or when the readme includes some instructions for installing f2py3 (or a suggestion regarding whether to alias f2py3 to point to f2py?)

katyhuff commented 5 years ago

Potentially related numpy issue: https://github.com/numpy/numpy/issues/7769

connorourke commented 5 years ago

Hi @katyhuff,

Thanks for agreeing to be editor on the submission.

The latest commits should solve this problem - f2py3 has been reverted to f2py, and the specification that python 3.5+ should be used has been added to the README.md file.

I have just tested pip install crystal _torture on the latest version on PyPI (crystal-torture 1.0.4) in both a clean python venv and a conda environment, which worked fine.