xraypy/xraylarch

Issue with re-installing Larch on Mac OSX

Closed this issue · 13 comments

Hello again,

Had to uninstall and re-install Anaconda Navigator as I had some issues. Now when trying to run my code in Spyder as before, I get the following error regarding the Larch package:

  File ~/anaconda3/lib/python3.11/site-packages/larch/__init__.py:1
    raise ImportError("larch cannot be installed with pip, try installing using conda-forge instead.\nSee https://larch.newman.me/getting-started.html for instructions.")

ImportError: larch cannot be installed with pip, try installing using conda-forge instead.
See https://larch.newman.me/getting-started.html for instructions.

Probably an easy fix but I can't work it out. Any assistance appreciated!

@Ayrtonb1 Not sure what you did. Can you do (from a Terminal):

  ~/anaconda3/bin/python -m pip install xraylarch

Hi Matt,

Thanks for getting back so quickly. For some reason I am getting this error in terminal after a short while:

` Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
+ meson setup /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-9q3oh0a9/pyfai_2689474bc8f44615abf8be8ffddd387e /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-9q3oh0a9/pyfai_2689474bc8f44615abf8be8ffddd387e/.mesonpy-6tm_wrhm -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-9q3oh0a9/pyfai_2689474bc8f44615abf8be8ffddd387e/.mesonpy-6tm_wrhm/meson-python-native-file.ini
The Meson build system
Version: 1.2.1
Source dir: /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-9q3oh0a9/pyfai_2689474bc8f44615abf8be8ffddd387e
Build dir: /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-9q3oh0a9/pyfai_2689474bc8f44615abf8be8ffddd387e/.mesonpy-6tm_wrhm
Build type: native build
Project name: pyFAI
Project version: 2023.9.0

  ../meson.build:1:0: ERROR: Unknown compiler(s): [['cc'], ['gcc'], ['clang'], ['nvc'], ['pgcc'], ['icc'], ['icx']]
  The following exception(s) were encountered:
  Running `nvc --version` gave "[Errno 2] No such file or directory: 'nvc'"
  Running `pgcc --version` gave "[Errno 2] No such file or directory: 'pgcc'"
  Running `icc --version` gave "[Errno 2] No such file or directory: 'icc'"
  Running `icx --version` gave "[Errno 2] No such file or directory: 'icx'"
  
  A full log can be found at /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-9q3oh0a9/pyfai_2689474bc8f44615abf8be8ffddd387e/.mesonpy-6tm_wrhm/meson-logs/meson-log.txt
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
`

No clue what's going on. Any ideas? I did try to install larch using the Spyder built-in Kernel and pip - maybe this is where the issue is coming from somehow?

@Ayrtonb1 I don't really know. It looks like it is coming from pyFAI. But the earlier errors appear to be coming from some other package called "larch".

It turns out that I do not know what you did, I only know what you included in your messages, which don't really explain what you did. As it turns out, I have no idea what Spyder does for the installation of packages. Please do not truncate or edit error messages or tracebacks.

For sure, it is possible (and reasonable) to install this X-ray Larch package into existing Python environments. It is much, much easier to support cases that have been installed into a dedicated environment, as all of the provided installers do.

That sort of means that if you are installing into your own environment, you sort of know what you are doing.

So, please explain what you have done and give complete error messages.

Hi there Matt,

Apologies, I have only just had chance to try and solve this again. I have uninstalled and reinstalled my Anaconda navigator and this seems to have solved the problem. However, when I try and use

~/anaconda3/bin/python -m pip install xraylarch

in a terminal, I received the following error. I have not truncated it as requested, and so it is quite long. Apologies. Any idea what is going on here? Thanks


Collecting xraylarch
  Obtaining dependency information for xraylarch from https://files.pythonhosted.org/packages/8c/e0/c75296da0801d3302b5068fa68d5d9783aacfa867958a08b95c5a668c762/xraylarch-0.9.71-py3-none-any.whl.metadata
  Using cached xraylarch-0.9.71-py3-none-any.whl.metadata (1.6 kB)
Requirement already satisfied: packaging in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (23.0)
Requirement already satisfied: pip in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (23.2.1)
Requirement already satisfied: pyyaml in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (6.0)
Requirement already satisfied: toml in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (0.10.2)
Requirement already satisfied: pytest in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (7.4.0)
Collecting termcolor (from xraylarch)
  Using cached termcolor-2.3.0-py3-none-any.whl (6.9 kB)
Requirement already satisfied: scipy>=1.7 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (1.10.1)
Requirement already satisfied: numpy>=1.20 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (1.24.3)
Requirement already satisfied: matplotlib>=3.5 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (3.7.1)
Collecting sqlalchemy>=2.0 (from xraylarch)
  Obtaining dependency information for sqlalchemy>=2.0 from https://files.pythonhosted.org/packages/49/ba/dfb0ce41f7e1dc9e1d816c8f538bbd95b0e2632175c3a5702532eb1813a7/SQLAlchemy-2.0.21-cp311-cp311-macosx_10_9_x86_64.whl.metadata
  Using cached SQLAlchemy-2.0.21-cp311-cp311-macosx_10_9_x86_64.whl.metadata (9.4 kB)
Collecting sqlalchemy-utils (from xraylarch)
  Using cached SQLAlchemy_Utils-0.41.1-py3-none-any.whl (92 kB)
Requirement already satisfied: h5py>=3.2 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (3.7.0)
Requirement already satisfied: pillow>=8.3.2 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (9.4.0)
Collecting psycopg2-binary (from xraylarch)
  Obtaining dependency information for psycopg2-binary from https://files.pythonhosted.org/packages/37/e6/7dd26ba148a02b7e78471ed7ce177e9890167994c5a1d4182361b9bee4cc/psycopg2_binary-2.9.7-cp311-cp311-macosx_10_9_x86_64.whl.metadata
  Using cached psycopg2_binary-2.9.7-cp311-cp311-macosx_10_9_x86_64.whl.metadata (4.4 kB)
Requirement already satisfied: dill in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (0.3.6)
Requirement already satisfied: imageio in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (2.31.1)
Requirement already satisfied: charset-normalizer in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (2.0.4)
Collecting peakutils (from xraylarch)
  Using cached PeakUtils-1.3.4-py3-none-any.whl (7.7 kB)
Requirement already satisfied: requests in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (2.31.0)
Requirement already satisfied: scikit-image in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (0.20.0)
Requirement already satisfied: scikit-learn in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (1.3.0)
Collecting asteval>=0.9.28 (from xraylarch)
  Obtaining dependency information for asteval>=0.9.28 from https://files.pythonhosted.org/packages/05/34/bdb51767967cb29302ee7dfe95662b057af7f23c62dd1967fc4b373656aa/asteval-0.9.31-py3-none-any.whl.metadata
  Using cached asteval-0.9.31-py3-none-any.whl.metadata (2.0 kB)
Collecting lmfit>=1.2.0 (from xraylarch)
  Obtaining dependency information for lmfit>=1.2.0 from https://files.pythonhosted.org/packages/16/87/d1b01fa4e4b69e0dea803592af88608c1c22eb4f92bfccf83ac66fa0792f/lmfit-1.2.2-py3-none-any.whl.metadata
  Using cached lmfit-1.2.2-py3-none-any.whl.metadata (9.9 kB)
Collecting uncertainties>=3.1 (from xraylarch)
  Using cached uncertainties-3.1.7-py2.py3-none-any.whl (98 kB)
Collecting pyshortcuts>=1.9.0 (from xraylarch)
  Using cached pyshortcuts-1.9.0-py3-none-any.whl (158 kB)
Collecting xraydb>=4.5 (from xraylarch)
  Obtaining dependency information for xraydb>=4.5 from https://files.pythonhosted.org/packages/70/f5/1bfd9dee2f4465c7ae4da968ef4afbf0793619e7fe833dd7a951fe0d8a51/xraydb-4.5.1-py3-none-any.whl.metadata
  Using cached xraydb-4.5.1-py3-none-any.whl.metadata (1.6 kB)
Collecting silx>=0.15.2 (from xraylarch)
  Using cached silx-1.1.2-cp311-cp311-macosx_10_9_universal2.whl (6.6 MB)
Collecting hdf5plugin (from xraylarch)
  Obtaining dependency information for hdf5plugin from https://files.pythonhosted.org/packages/2d/76/d25e6aa8b74bc9545a9a1d3b981e7089dc2eee927cc0272b2e0f891e9a91/hdf5plugin-4.2.0-py3-none-macosx_10_9_universal2.whl.metadata
  Using cached hdf5plugin-4.2.0-py3-none-macosx_10_9_universal2.whl.metadata (2.8 kB)
Collecting numdifftools (from xraylarch)
  Using cached numdifftools-0.9.41-py2.py3-none-any.whl (100 kB)
Requirement already satisfied: psutil in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (5.9.0)
Collecting pymatgen (from xraylarch)
  Obtaining dependency information for pymatgen from https://files.pythonhosted.org/packages/94/25/54a0da147ead5d0f75a8695ad7c94d693344226464ae49113ce9c828381d/pymatgen-2023.9.25-cp311-cp311-macosx_10_9_x86_64.whl.metadata
  Downloading pymatgen-2023.9.25-cp311-cp311-macosx_10_9_x86_64.whl.metadata (12 kB)
Collecting fabio (from xraylarch)
  Obtaining dependency information for fabio from https://files.pythonhosted.org/packages/e3/c9/a7288b7eb8e4fb4076d470ac9936e23946b250de9342806403af4a62bdca/fabio-2023.6.0-cp311-cp311-macosx_10_15_x86_64.whl.metadata
  Using cached fabio-2023.6.0-cp311-cp311-macosx_10_15_x86_64.whl.metadata (15 kB)
Collecting pyfai (from xraylarch)
  Using cached pyfai-2023.9.0.tar.gz (54.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      + meson setup /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb/.mesonpy-gz3i__8v -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb/.mesonpy-gz3i__8v/meson-python-native-file.ini
      The Meson build system
      Version: 1.2.1
      Source dir: /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb
      Build dir: /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb/.mesonpy-gz3i__8v
      Build type: native build
      Project name: pyFAI
      Project version: 2023.9.0
      
      ../meson.build:1:0: ERROR: Unknown compiler(s): [['cc'], ['gcc'], ['clang'], ['nvc'], ['pgcc'], ['icc'], ['icx']]
      The following exception(s) were encountered:
      Running `nvc --version` gave "[Errno 2] No such file or directory: 'nvc'"
      Running `pgcc --version` gave "[Errno 2] No such file or directory: 'pgcc'"
      Running `icc --version` gave "[Errno 2] No such file or directory: 'icc'"
      Running `icx --version` gave "[Errno 2] No such file or directory: 'icx'"
      
      A full log can be found at /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb/.mesonpy-gz3i__8v/meson-logs/meson-log.txt
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@Ayrtonb1 Hm, it looks like it is trying and failing to build pyFAI from the source code. I'm not sure why that pip install is not finding an appropriate wheel.

I would suggest trying to first install pyFAI from conda / mamba. If that works, I think that xraylarch then should properly install with pip install.

Hi Matt, Thanks for this message. I have been spending some time trying to get around this error, however I cannot seem to install pyFAI and wind up with the same error described above, I.E.

Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

I've looked online and tried to find ways around it such as using a virtual environment, or by bypassing the cache, as well as some others, but cannot seem to solve this error for pyFAI and therefore for xraylarch installation. I am not very famliar with using terminal. Do you have any further suggestions that may help?

@Ayrtonb1 The error you are getting is again incomplete and deliberately truncated. I have asked you a couple of times to explain exactly what you did and give complete error messages. You say that the error you are getting comes from installing pyFAI (not from xraylarch) into your own Python environment, but I actually do not have any idea what you did.

Now, installing xraylarch into your own Python environment can definitely be done. Many people do this. I can try to help with such situations: we want that to work well. But in order to be able to support such cases, you absolutely must give complete information about what you are doing and give full error messages. You have kind of consistently and repeatedly not done this.

At this point, I recommend that you install Larch with the GetLarch.sh script (https://raw.githubusercontent.com/xraypy/xraylarch/master/installers/GetLarch.sh) and then assessing why you want to run xraylarch from your other Python environment.

Hi Matt,

Apologies for my lack of clarity on the matter. Due to my inexperience with using Terminal I wanted to avoid overcomplicating the issue with too much code-related jargon if it was indeed a common problem with a simple solve. In future I will include full error messages.

To be clear, I am just trying to install xraylarch as you have suggested in the terminal on Mac OSX using

~/anaconda3/bin/python -m pip install xraylarch

However I get the error message as described above:

`Collecting xraylarch
Obtaining dependency information for xraylarch from https://files.pythonhosted.org/packages/8c/e0/c75296da0801d3302b5068fa68d5d9783aacfa867958a08b95c5a668c762/xraylarch-0.9.71-py3-none-any.whl.metadata
Using cached xraylarch-0.9.71-py3-none-any.whl.metadata (1.6 kB)
Requirement already satisfied: packaging in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (23.0)
Requirement already satisfied: pip in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (23.2.1)
Requirement already satisfied: pyyaml in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (6.0)
Requirement already satisfied: toml in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (0.10.2)
Requirement already satisfied: pytest in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (7.4.0)
Collecting termcolor (from xraylarch)
Using cached termcolor-2.3.0-py3-none-any.whl (6.9 kB)
Requirement already satisfied: scipy>=1.7 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (1.10.1)
Requirement already satisfied: numpy>=1.20 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (1.24.3)
Requirement already satisfied: matplotlib>=3.5 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (3.7.1)
Collecting sqlalchemy>=2.0 (from xraylarch)
Obtaining dependency information for sqlalchemy>=2.0 from https://files.pythonhosted.org/packages/49/ba/dfb0ce41f7e1dc9e1d816c8f538bbd95b0e2632175c3a5702532eb1813a7/SQLAlchemy-2.0.21-cp311-cp311-macosx_10_9_x86_64.whl.metadata
Using cached SQLAlchemy-2.0.21-cp311-cp311-macosx_10_9_x86_64.whl.metadata (9.4 kB)
Collecting sqlalchemy-utils (from xraylarch)
Using cached SQLAlchemy_Utils-0.41.1-py3-none-any.whl (92 kB)
Requirement already satisfied: h5py>=3.2 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (3.7.0)
Requirement already satisfied: pillow>=8.3.2 in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (9.4.0)
Collecting psycopg2-binary (from xraylarch)
Obtaining dependency information for psycopg2-binary from https://files.pythonhosted.org/packages/37/e6/7dd26ba148a02b7e78471ed7ce177e9890167994c5a1d4182361b9bee4cc/psycopg2_binary-2.9.7-cp311-cp311-macosx_10_9_x86_64.whl.metadata
Using cached psycopg2_binary-2.9.7-cp311-cp311-macosx_10_9_x86_64.whl.metadata (4.4 kB)
Requirement already satisfied: dill in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (0.3.6)
Requirement already satisfied: imageio in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (2.31.1)
Requirement already satisfied: charset-normalizer in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (2.0.4)
Collecting peakutils (from xraylarch)
Using cached PeakUtils-1.3.4-py3-none-any.whl (7.7 kB)
Requirement already satisfied: requests in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (2.31.0)
Requirement already satisfied: scikit-image in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (0.20.0)
Requirement already satisfied: scikit-learn in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (1.3.0)
Collecting asteval>=0.9.28 (from xraylarch)
Obtaining dependency information for asteval>=0.9.28 from https://files.pythonhosted.org/packages/05/34/bdb51767967cb29302ee7dfe95662b057af7f23c62dd1967fc4b373656aa/asteval-0.9.31-py3-none-any.whl.metadata
Using cached asteval-0.9.31-py3-none-any.whl.metadata (2.0 kB)
Collecting lmfit>=1.2.0 (from xraylarch)
Obtaining dependency information for lmfit>=1.2.0 from https://files.pythonhosted.org/packages/16/87/d1b01fa4e4b69e0dea803592af88608c1c22eb4f92bfccf83ac66fa0792f/lmfit-1.2.2-py3-none-any.whl.metadata
Using cached lmfit-1.2.2-py3-none-any.whl.metadata (9.9 kB)
Collecting uncertainties>=3.1 (from xraylarch)
Using cached uncertainties-3.1.7-py2.py3-none-any.whl (98 kB)
Collecting pyshortcuts>=1.9.0 (from xraylarch)
Using cached pyshortcuts-1.9.0-py3-none-any.whl (158 kB)
Collecting xraydb>=4.5 (from xraylarch)
Obtaining dependency information for xraydb>=4.5 from https://files.pythonhosted.org/packages/70/f5/1bfd9dee2f4465c7ae4da968ef4afbf0793619e7fe833dd7a951fe0d8a51/xraydb-4.5.1-py3-none-any.whl.metadata
Using cached xraydb-4.5.1-py3-none-any.whl.metadata (1.6 kB)
Collecting silx>=0.15.2 (from xraylarch)
Using cached silx-1.1.2-cp311-cp311-macosx_10_9_universal2.whl (6.6 MB)
Collecting hdf5plugin (from xraylarch)
Obtaining dependency information for hdf5plugin from https://files.pythonhosted.org/packages/2d/76/d25e6aa8b74bc9545a9a1d3b981e7089dc2eee927cc0272b2e0f891e9a91/hdf5plugin-4.2.0-py3-none-macosx_10_9_universal2.whl.metadata
Using cached hdf5plugin-4.2.0-py3-none-macosx_10_9_universal2.whl.metadata (2.8 kB)
Collecting numdifftools (from xraylarch)
Using cached numdifftools-0.9.41-py2.py3-none-any.whl (100 kB)
Requirement already satisfied: psutil in ./anaconda3/lib/python3.11/site-packages (from xraylarch) (5.9.0)
Collecting pymatgen (from xraylarch)
Obtaining dependency information for pymatgen from https://files.pythonhosted.org/packages/94/25/54a0da147ead5d0f75a8695ad7c94d693344226464ae49113ce9c828381d/pymatgen-2023.9.25-cp311-cp311-macosx_10_9_x86_64.whl.metadata
Downloading pymatgen-2023.9.25-cp311-cp311-macosx_10_9_x86_64.whl.metadata (12 kB)
Collecting fabio (from xraylarch)
Obtaining dependency information for fabio from https://files.pythonhosted.org/packages/e3/c9/a7288b7eb8e4fb4076d470ac9936e23946b250de9342806403af4a62bdca/fabio-2023.6.0-cp311-cp311-macosx_10_15_x86_64.whl.metadata
Using cached fabio-2023.6.0-cp311-cp311-macosx_10_15_x86_64.whl.metadata (15 kB)
Collecting pyfai (from xraylarch)
Using cached pyfai-2023.9.0.tar.gz (54.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
+ meson setup /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb/.mesonpy-gz3i__8v -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb/.mesonpy-gz3i__8v/meson-python-native-file.ini
The Meson build system
Version: 1.2.1
Source dir: /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb
Build dir: /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb/.mesonpy-gz3i__8v
Build type: native build
Project name: pyFAI
Project version: 2023.9.0

  ../meson.build:1:0: ERROR: Unknown compiler(s): [['cc'], ['gcc'], ['clang'], ['nvc'], ['pgcc'], ['icc'], ['icx']]
  The following exception(s) were encountered:
  Running `nvc --version` gave "[Errno 2] No such file or directory: 'nvc'"
  Running `pgcc --version` gave "[Errno 2] No such file or directory: 'pgcc'"
  Running `icc --version` gave "[Errno 2] No such file or directory: 'icc'"
  Running `icx --version` gave "[Errno 2] No such file or directory: 'icx'"
  
  A full log can be found at /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-1cu81rhl/pyfai_483e8a60313748c7be4d26874ea2a2fb/.mesonpy-gz3i__8v/meson-logs/meson-log.txt
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.`

Then, I have tried to install pyFAI separately as it seems xraylarch is experiencing an installation issue as a result of pyFAI as you said. However, I can't install this either. I am using the command

pip install pyFAI

I have also tried solving the problem by ignoring the cache, using:

pip install --no-cache-dir pyFAI

or by alternatively using:

pip install pyFAI --use-deprecated=legacy-resolver

I have also tried using conda:

conda install pyfai -c conda-forge

I have also tried using a virtual environment before attempting installation, as in:

python -m venv venv source venv/bin/activate

and have tried updating the pip package by:

pip install wheel setuptools pip --upgrade

These are most of the things I have tried, and have. tried replacing pyFAI with xraylarch in the above commands. However, in these above cases I still get the same error message for both pyFAI and for xraylarch, I.E.:

`Collecting pyFAI
Downloading pyfai-2023.9.0.tar.gz (54.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.8/54.8 MB 23.4 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
+ meson setup /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-8r63qrl1/pyfai_72a71cc4b54a4e62a024db586ef8f83e /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-8r63qrl1/pyfai_72a71cc4b54a4e62a024db586ef8f83e/.mesonpy-3qw2muqo -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-8r63qrl1/pyfai_72a71cc4b54a4e62a024db586ef8f83e/.mesonpy-3qw2muqo/meson-python-native-file.ini
The Meson build system
Version: 1.2.2
Source dir: /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-8r63qrl1/pyfai_72a71cc4b54a4e62a024db586ef8f83e
Build dir: /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-8r63qrl1/pyfai_72a71cc4b54a4e62a024db586ef8f83e/.mesonpy-3qw2muqo
Build type: native build
Project name: pyFAI
Project version: 2023.9.0

  ../meson.build:1:0: ERROR: Unknown compiler(s): [['cc'], ['gcc'], ['clang'], ['nvc'], ['pgcc'], ['icc'], ['icx']]
  The following exception(s) were encountered:
  Running `nvc --version` gave "[Errno 2] No such file or directory: 'nvc'"
  Running `pgcc --version` gave "[Errno 2] No such file or directory: 'pgcc'"
  Running `icc --version` gave "[Errno 2] No such file or directory: 'icc'"
  Running `icx --version` gave "[Errno 2] No such file or directory: 'icx'"
  
  A full log can be found at /private/var/folders/98/2v6x4hv55wjcswn19y_blzlh0000gn/T/pip-install-8r63qrl1/pyfai_72a71cc4b54a4e62a024db586ef8f83e/.mesonpy-3qw2muqo/meson-logs/meson-log.txt
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
`

Apologies, I am not sure how to use the .sh github link you sent as an alternative, either, and I can't find any further resources online about how to resolve this error. Are you able to help? Apologies if this is the wrong place for this issue. Hopefully I have included enough information about what I have been trying. Any help is appreciated! Thank you again

@Ayrtonb1 Again, you are describing troubles installing pyFAI into your own, custom Python installation. Did you ask the pyFAI folks why that does not install into your Python environment?

Did you try doing a conda update? I don't think you ever said a) what version of Python or Anaconda you were using or b) why you are trying to install Larch into your own custom environment. Those would all be completely normal things to communicate.

Is it important to you that you run Larch in your custom environment? If it is, then I think you are going to need to understand a little bit about how installing these packages works.

Again, I would suggest that you install Larch in the normal, documented, supported way, and see if that works for you. It works for lots of people.

Hi Matt, Thanks for your reply. The reason I'm describing my troubles installing pyFAI is because that is where my issues with installing xraylarch arise from. I can't seem to find a forum to discuss issues about pyFAI directly but seeing as I am actually just trying to reinstall xraylarch (as far as I know I am trying this in the normal, documented, supported way, that being the method you suggested earlier - please correct me if I am wrong) I figured here would be a good place to start. I am using conda 23.7.4 and Python 3.11.5 which I believe to be the most up-to-date versions.

I am using terminal to try and download this, as opposed to a custom python environment, and that is where the issue with installing xraylarch arises. Is there any other further information I can provide that may help get to the bottom of this?

Hi Matt,

I think I managed to install after having a call with a friend more knowledgeable about these things than myself. However, I am still getting this error when I try to run my script in Python using Spyder:

`Traceback (most recent call last):

  File ~/anaconda3/lib/python3.11/site-packages/spyder_kernels/py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File ~/PycharmProjects/beamtime_10_9_22/DAFS_GUI.py:24
    from larch.xafs import diffkk

ModuleNotFoundError: No module named 'larch'`

Am I calling this correctly? Or should I be calling larch a different way? Thanks again

@Ayrtonb1 Again you said you did a bunch of stuff and want my help and deliberately decided to not tell me exactly what you did. Like, did you run pip install xraylarch?

Why are you not running Larch from the supported installer?

I am working today on a new release of Larch (0.9.72) and new installer scripts for Windows and MacOS. These will be the supported environments. I strongly encourage you to install use Larch using these installers.

Larch is open source and you can choose to run Larch in a different Python environment. In fact, several people do this. I try to help those who want to do this, but that assumes that they have some familiarity with Python, know how to install packages, and can communicate effectively about issues they are having.

@Ayrtonb1 I think this issue is no longer valid. Please, follow the installation steps in the documentation and if it still does not work, make a clear report.