nexpy / nxrefine

Module to enable [hkl] transformation of single-crystal x-ray scattering
Other
4 stars 5 forks source link

installing from scratch gives import error #5

Open keeble opened 2 years ago

keeble commented 2 years ago

Hi, I'm trying to get the 3d-DPDF stack working at diamond. Creating a clean conda env, installing the named dependencies, and then pip installing nxrefine leads to an import error. I think it will work against the master branch of nexusformat, but I don't think it's yet made it onto conda-forge.

Steps taken

conda create -p /path/to/env python
conda activate /path/to/env
conda install nexpy cctbx-base pyfai sqlalchemy psutil
git clone https://github.com/axmas-anl/nxrefine.git
pip install nxrefine/
nxrefine

leads to

Traceback (most recent call last):
  File "/scratch/nxrefine/2/env/bin/nxrefine", line 5, in <module>
    from nxrefine.scripts.nxrefine import main
  File "/scratch/nxrefine/2/env/lib/python3.10/site-packages/nxrefine/scripts/nxrefine.py", line 12, in <module>
    from nxrefine.nxreduce import NXMultiReduce, NXReduce
  File "/scratch/nxrefine/2/env/lib/python3.10/site-packages/nxrefine/nxreduce.py", line 24, in <module>
    from nexusformat.nexus import (NeXusError, NXattenuator, NXcollection, NXdata,
ImportError: cannot import name 'nxsetlockexpiry' from 'nexusformat.nexus' (/scratch/nxrefine/2/env/lib/python3.10/site-packages/nexusformat/nexus/__init__.py)

Quite possible this should be an issue in nexusformat named "please release 0.7.5" but my issue started here so... I'm starting here!

Thanks, Dean

keeble commented 2 years ago

workaround is to install nexusformat from source over the top of conda. Following the above:

git clone https://github.com/nexpy/nexusformat.git
pip install nexusformat/
nxrefine

yields

usage: nxrefine [-h] -d DIRECTORY [-e ENTRIES [ENTRIES ...]] [-l] [-o] [-q]
nxrefine: error: the following arguments are required: -d/--directory

which feels like it's probably working.

rayosborn commented 2 years ago

I will try to issue a new release of nexusformat as soon as possible, hopefully today or tomorrow. We have been using a development version while modifying nxrefine for an APS experiment we have just been running, and were trying out new features that are not yet in the latest PyPI and conda-forge versions.

It might be an idea to have a Zoom call to discuss other potential issues. We run this package at APS and periodically update a version at CHESS, so these issues have been under our control. However, I am happy to move to a more stable release model so that you are not affected by the vagaries of our development process.

If you need to run before then, you can try cloning the nexusformat Github repository. The master branch should fix this.

Edit: I see our messages crossed, but that should be right.

keeble commented 2 years ago

Thanks Ray, no need to rush on my account - for the time being just having it running on my workstation is going to be fine and so if I need to jump through a hoop or two it's no problem.

At some point in the future I'll get this installed properly in it's own env in our module system so all our users get the same thing on any machine, including on our cluster compute. I will attempt to record the hoops I'm jumping through now, so that we can try and remove them in the future.

A zoom call would be good if there are issues you can foresee; I could probably also do with a crash course in actually... using it at some point as well!