xraypy / xraylarch

Larch: Applications and Python Library for Data Analysis of X-ray Absorption Spectroscopy (XAS, XANES, XAFS, EXAFS), X-ray Fluorescence (XRF) Spectroscopy and Imaging, and more.
https://xraypy.github.io/xraylarch
Other
133 stars 64 forks source link

Problem after update on Ubuntu #433

Closed njanot closed 1 year ago

njanot commented 1 year ago

Hello, Last time I opened XAS Viewer, an update was suggested. Unfortunately, since then, Larch does not start. I have started the installation from scratch again but it won't start. Here is the error messages I get:Collecting wxutils Using cached wxutils-0.3.0-py3-none-any.whl (40 kB) Collecting wxmplot Using cached wxmplot-0.9.55-py3-none-any.whl (95 kB) Collecting wxPython Using cached wxPython-4.2.0.tar.gz (71.0 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [12 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-ghm2prwg/wxpython_db1278607d9a4a48ac373f8be510612c/setup.py", line 27, in from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName File "/tmp/pip-install-ghm2prwg/wxpython_db1278607d9a4a48ac373f8be510612c/buildtools/config.py", line 30, in from attrdict import AttrDict File "/home/njanot/xraylarch/lib/python3.10/site-packages/attrdict/init.py", line 5, in from attrdict.mapping import AttrMap File "/home/njanot/xraylarch/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in from collections import Mapping ImportError: cannot import name 'Mapping' from 'collections' (/home/njanot/xraylarch/lib/python3.10/collections/init.py) [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. WARNING [2023-05-22 16:53:48]: could not pip install packages: {'wxutils', 'wxmplot'} Collecting pyepics Using cached pyepics-3.5.1.tar.gz (5.8 MB) Preparing metadata (setup.py) ... done Collecting psycopg2-binary Using cached psycopg2_binary-2.9.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB) Collecting epicsapps Using cached epicsapps-0.9.3-py3-none-any.whl (397 kB) Requirement already satisfied: setuptools in ./lib/python3.10/site-packages (from pyepics) (65.6.3) Requirement already satisfied: lmfit in ./lib/python3.10/site-packages (from epicsapps) (1.2.1) Requirement already satisfied: pyshortcuts in ./lib/python3.10/site-packages (from epicsapps) (1.9.0) Requirement already satisfied: pyyaml in ./lib/python3.10/site-packages (from epicsapps) (6.0) Requirement already satisfied: sqlalchemy in ./lib/python3.10/site-packages (from epicsapps) (2.0.15) Requirement already satisfied: numpy in ./lib/python3.10/site-packages (from epicsapps) (1.24.3) Requirement already satisfied: xraydb in ./lib/python3.10/site-packages (from epicsapps) (4.5.0) Collecting wxpython Using cached wxPython-4.2.0.tar.gz (71.0 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [12 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-a9tiv34n/wxpython_332fa75577ec48e39ddb0cf9aca3b0dd/setup.py", line 27, in from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName File "/tmp/pip-install-a9tiv34n/wxpython_332fa75577ec48e39ddb0cf9aca3b0dd/buildtools/config.py", line 30, in from attrdict import AttrDict File "/home/njanot/xraylarch/lib/python3.10/site-packages/attrdict/init.py", line 5, in from attrdict.mapping import AttrMap File "/home/njanot/xraylarch/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in from collections import Mapping ImportError: cannot import name 'Mapping' from 'collections' (/home/njanot/xraylarch/lib/python3.10/collections/init.py) [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. WARNING [2023-05-22 16:53:56]: could not pip install packages: {'pyepics', 'psycopg2-binary', 'epicsapps'} Traceback (most recent call last): File "/home/njanot/xraylarch/bin/larch", line 8, in sys.exit(run_larch()) File "/home/njanot/xraylarch/lib/python3.10/site-packages/larch/apps.py", line 282, in run_larch cli = Shell(quiet=args.quiet, with_wx=with_wx) File "/home/njanot/xraylarch/lib/python3.10/site-packages/larch/shell.py", line 86, in init banner_msg = make_banner(show_libraries=['numpy', 'scipy', 'matplotlib', 'h5py', File "/home/njanot/xraylarch/lib/python3.10/site-packages/larch/version.py", line 101, in make_banner from wxmplot.interactive import get_wxapp ModuleNotFoundError: No module named 'wxmplot'


"pip install wxmplot" does not work neither, I got the following messages:

Collecting wxmplot Using cached wxmplot-0.9.55-py3-none-any.whl (95 kB) Collecting wxPython>=4.1.0 Using cached wxPython-4.2.0.tar.gz (71.0 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [12 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-lkvyq02b/wxpython_704316af4b25464682521e9e66f3d4a1/setup.py", line 27, in from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName File "/tmp/pip-install-lkvyq02b/wxpython_704316af4b25464682521e9e66f3d4a1/buildtools/config.py", line 30, in from attrdict import AttrDict File "/home/njanot/xraylarch/lib/python3.10/site-packages/attrdict/init.py", line 5, in from attrdict.mapping import AttrMap File "/home/njanot/xraylarch/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in from collections import Mapping ImportError: cannot import name 'Mapping' from 'collections' (/home/njanot/xraylarch/lib/python3.10/collections/init.py) [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.

Could you help me resolving this issue ?

newville commented 1 year ago

@njanot Hm, I'm not sure what would cause that.

You say you started the installation from scratch. Do you mean that you removed /home/njanot/xraylarch and did a fresh install with GetLarch.sh? Or did you install some other way?

If you have a different Python in your environment, I suggest getting the latest GetLarch.sh and doing

pip cache purge
rm -rf /home/njanot/xraylarch
sh GetLarch.sh

This should definitely NOT try to install wxPython from a source ".tar.gz" file -- I can completely believe that will not work due to some missing library.

If that fails, can you include the full output, showing which packages mamba did actually install?

njanot commented 1 year ago

Hi Matt, Thank you for your answer ! I did just what you said, and here is what I got GetLarch.log But in my terminal I have error messages that do not show in the log. Last step is Creating desktop shortcuts, and apparently this is where it gets wrong :

Creating desktop shortcuts

Collecting wxutils Using cached wxutils-0.3.0-py3-none-any.whl (40 kB) Collecting wxmplot Using cached wxmplot-0.9.55-py3-none-any.whl (95 kB) Collecting wxPython Using cached wxPython-4.2.0.tar.gz (71.0 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [8 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-23x194mn/wxpython_4aed3cd7521f4244935b8f0f85c51a1d/setup.py", line 27, in from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName File "/tmp/pip-install-23x194mn/wxpython_4aed3cd7521f4244935b8f0f85c51a1d/buildtools/config.py", line 30, in from attrdict import AttrDict ModuleNotFoundError: No module named 'attrdict' [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. WARNING [2023-05-23 10:04:54]: could not pip install packages: {'wxutils', 'wxmplot'} ##############

Larch Installation to /home/njanot/xraylarch done.

Applications can be run from the Larch folder on your Desktop.

To use from a terminal, you may want to add:

    export PATH=/home/njanot/xraylarch/bin:$PATH

to your /bin/bash startup script.

See GetLarch.log for complete log and error messages

##############

newville commented 1 year ago

@njanot Thanks. That log definitely says that the wxpython package was not installed by mamba, and it definitely should have been. Without that installed by mamba/conda, the pip install will try to install from source, which has a pretty low probability of success unless your environment is set up with that in mind (and that is definitely not the intention!!)

I think that doing

    /home/njanot/xraylarch/bin/mamba install -yc conda-forge wxpython 
    /home/njanot/xraylarch/bin/pip install xraylarch

should work. But I'll look into checking out why wxpython was not included in the "mamba/conda packages", and making sure that it is, at least by default.

njanot commented 1 year ago

That seems to work, thank you so much for your feedback !