Project

General

Profile

python syscheck.py fails because of missing (internal?) pyami.fileutil module?

Added by Patrick Goetz over 7 years ago

cnsit@kraken:~$ cd leginon/myami-3.2/leginon/
cnsit@kraken:~/leginon/myami-3.2/leginon$ python syscheck.py
Traceback (most recent call last):
File "syscheck.py", line 49, in <module>
import pyami.fileutil
ImportError: No module named pyami.fileutil

This looks like an internal python module that missing from the svn download?


Replies (6)

RE: python syscheck.py fails because of missing (internal?) pyami.fileutil module? - Added by Anchi Cheng over 7 years ago

Check your PYTHON_PATH.

If you installed all python modules with setup.py, python should find this module in its site-packages/pyami.

If you did not install but use your local file, you need to set PYTHON_PATH environment variable so that python can find it.

For example, for bash

export MYAMIPATH=/home/acheng/myami
export PYTHONPATH=$MYAMIPATH:$MYAMIPATH/leginon:$MYAMIPATH/appion:$PYTHONPATH
export PATH=$MYAMIPATH/appion/bin:$PATH

RE: python syscheck.py fails because of missing (internal?) pyami.fileutil module? - Added by Patrick Goetz over 7 years ago

Ah, so I did not run setup.py, as this wasn't in the instruction path in the wiki that I am following (it's not on the Ubuntu install page, either (but that page is hopelessly incomplete and out of date).

The installation instructions progress from:

Here:
http://emg.nysbc.org/projects/leginon/wiki/Download_Leginon_Files

to here:
http://emg.nysbc.org/projects/leginon/wiki/Perform_system_check

So, it looks like `python setup.py` is executed out of the pysetup.sh script in the myami-3.2 root directory. I looked at that shell script, and it looks like it installs everything. Since right now I am just installing the processing/web/db machine, I assumed there are some parts of this (e.g. microsoft control) that I don't want. That's why I was going through the step by step installation outlined in the Wiki.

If I can find out which sections need to be installed on the processing system, I can probably just go into those directories and run `python setup.py` by hand. If everything mentioned in pysetup.sh is needed, please let me know. It doesn't seem to be explained in the Wiki.

RE: python syscheck.py fails because of missing (internal?) pyami.fileutil module? - Added by Anchi Cheng over 7 years ago

Good point. I have not follow this exactly from scratch for a while. pyami.fileutil is needed for a purpose that has since separated from syscheck. I will change the code to skip that part. Thanks.

As far as what to ignore. Just ignore any Windows instruction, but check against Appion installation instruction. Folks who wrote that instruction assumes that you have used CentOS autoinstaller, so the details you need can only be found in Leginon installation, but you do need to do a few additional setup for Appion.

RE: python syscheck.py fails because of missing (internal?) pyami.fileutil module? - Added by Patrick Goetz over 7 years ago

I'm a little confused now.

The pyscope folder seems to include code aimed at controlling the microscope, but I don't see anything windows-specific about this. Regarding pyami.fileutil , are you saying this module doesn't need to be imported and that line in syscheck.py can just be commented out?

I can parse through to the CentOS autoinstaller to see what it does, but be aware that somewhere in your documentation there is the following statement: "You probably do not want to use the CentOS autoinstaller on a production system". I can't remember what page I saw this on, but can find the link, if necessary.

I think the problem maybe is that the Install Leginon Packages Wiki page needs to come in the sequence before Perform system check.

RE: python syscheck.py fails because of missing (internal?) pyami.fileutil module? - Added by Anchi Cheng over 7 years ago

Just fixed syscheck.py in Issue #5161, You can compare.

syscheck.py is meant to check if you have the supporting python packages which is why it comes before Install Leginon Packages. Python can find module within your current directory.

pyscope does have Windows specific code (anything has to do with COM). However, they are not imported or used unless they are installed on Windows. I just meant that you should ignore Installation_on_the_instrument_computers. Those are all Windows.

AutoInstallor is a working installation. It is not for production because it is installed while as root and is only configured to be used as root. See Changes_to_auto-installed_appion_for_production_usage You can not access the webserver outside the local machine, either.

RE: python syscheck.py fails because of missing (internal?) pyami.fileutil module? - Added by Patrick Goetz about 7 years ago

Great! After making those modifications I can now run `python syscheck.py` and everything comes back as OK. Thanks

    (1-6/6)