rigdenlab / SIMBAD

Sequence Independent Molecular replacement Based on Available Database
http://simbad.rtfd.io
BSD 3-Clause "New" or "Revised" License
3 stars 7 forks source link

setup.py automated installation #5

Closed hlasimpk closed 7 years ago

hlasimpk commented 7 years ago
Cannot find configuration file: /Applications/ccp4-7.0/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simbad-0.0.1-py2.7.egg/simbad/static/simbad.ini - terminating...

**********************************************************************
*******************          SIMBAD ERROR          *******************
**********************************************************************

Error running main SIMBAD program: Cannot find configuration file: /Applications/ccp4-7.0/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simbad-0.0.1-py2.7.egg/simbad/static/simbad.ini - terminating...

**********************************************************************
fsimkovic commented 7 years ago

What is the command you run to reproduce this? Did you use ccp4-python setup.py develop or install?

hlasimpk commented 7 years ago

I used ccp4-python setup.py install.

Could this have caused the issue?

hlasimpk commented 7 years ago

So I've run it with the develop flag and it worked fine, out of curiosity, why doesn't install do that?

fsimkovic commented 7 years ago

Could you try the following?

ccp4-python -m pip uninstall simbad
ccp4-python setup.py install
simbad <MTZ>

Maybe re-installing it resolves the issue. Also, cd out of the SIMBAD directory, maybe the import picks up the wrong directory by accident.

hlasimpk commented 7 years ago

Tried it, same result as before. When I look in /Applications/ccp4-7.0/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simbad-0.0.1-py2.7.egg/simbad/

I can see util and parsers but not static, as if the file is not being copied across.

fsimkovic commented 7 years ago

There seems to be an issue on OS X that puts the simbad script not in the $CCP4/bin directory but instead to $CCP4/Frameworks/Python.framework/Versions/2.7/bin. The executable is not picked up and I'm not entirely sure which simbad script you are executing but not the right now.

The solution is to use the following command during installation

ccp4-python setup.py install --install-scripts $CCP4/bin --force

The --force re-installs everything (only essential now).

hlasimpk commented 7 years ago

Just tested out the command

ccp4-python setup.py install --install-scripts $CCP4/bin --force

This solved the issue with the simbad.exe being put in $CCP4/Frameworks/Python.framework/Versions/2.7/bin however this error still remains:

Error running main SIMBAD program: Cannot find configuration file: /Applications/ccp4-7.0/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simbad-0.0.1-py2.7.egg/simbad/static/simbad.ini - terminating...

fsimkovic commented 7 years ago

Maybe try the following:

$ cd ~/Downloads
$ rm -rf /Applications/ccp4-7.0/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simbad-0.0.1-py2.7.egg /Applications/ccp4-7.0/bin/simbad
$ git clone https://github.com/rigdenlab/SIMBAD.git
$ cd SIMBAD
$ ccp4-python setup.py install --install-scripts $CCP4/bin > log 2>&1 &
$ simbad -mtz <MTZ FILE>

Let me know how that goes. If it fails, post the contents of the log file.

hlasimpk commented 7 years ago

I've tried your last suggestion on the setup bug. Still no solution but I can give you some extra information.

When I follow your instructions, i.e. I delete the egg files, download a new clone of SIMBAD, do setup.py install etc.. and run SIMBAD in the SIMBAD directory, the simbad.ini file in the local simbad/static dir is found (note that the static dir is not copied to the egg directory in ccp4). However this crashes when I try to run SIMBAD, here's the debug.log.

It looks like the pickle file containing the PDB information cannot be found/read which is also located in the simbad/static dir.

I also tried running this outside of the SIMBAD directory which results in the same crash I was getting before.

fsimkovic commented 7 years ago

Please post the log file from your installation. That's much more informative about what's going on here.

It's clear that your installation doesn't move the files across to the EGG but I want to be sure.

hlasimpk commented 7 years ago

Here is that log

fsimkovic commented 7 years ago
$ find $CCP4 -name simbad* | xargs rm -rf
$ cd ~/Downloads
$ git clone https://github.com/rigdenlab/SIMBAD.git && cd SIMBAD
$ ccp4-python setup.py install --prefix $CCP4 --install-scripts $CCP4/bin
$ cd .. && rm -rf SIMBAD
$ simbad -mtz <MTZ FILE>

See if this works ...

hlasimpk commented 7 years ago

Looks like that worked! I'm going to close this now

fsimkovic commented 7 years ago

Let's sort the file structure to the following:

static ==> $CCP4/share scripts ==> $CCP4/bin source ==> $CCP4/lib/python2.7/site-packages

fsimkovic commented 7 years ago

It appears as if I found a good solution to solving this entire installation problem. Changes commited to ConKit in rigdenlab/conkit@3eb47a9cf65146f0bcb50d2dcbb62f880c0d7bc6. Basic approach in ConKit consists of the following:

ccp4-python setup.py install \
    --install-scripts=$CCP4/bin \
    --install-lib=$CCP4/lib/py2/site-packages \
    --script-python-path=ccp4-python

The first two flags --install-scripts and --install-lib are basic install flags provided by setuptools. The flag --script-python-path is a custom flag and basically adds the ccp4-python binary to the generated scripts.

Any thoughts @hlasimpk? Do you think we should default these and leave the flags available for an installations outside of CCP4? Is this even possible or does SIMBAD depend too much on CCP4 dependencies?

fsimkovic commented 7 years ago

Changes for installation commited in 2d0f0a66fb1cba14cc9814114c6297b4ae4006cb. Closing this issue as this seems the most pythonic and setuptools-like.