Closed lnaglecocco closed 11 months ago
@lnaglecocco I think that the problem is that Python 3.12 was installed and maybe not all the packages are consistently available with Python 3.12.
I might suggest that you try starting with
conda create -y --name xraylarch python==3.11.5
Hi @newville , thanks for getting back to me! Apologies for my slow response.
I have tried following your advice, i.e. forcing the python to be 3.11.5 . I have run conda install -y -c conda-forge wxpython pymatgen scipy h5py matplotlib
without issue, but when I then run pip install xraylarch
I get an error message.
Below I include the output from conda list
before running pip install xraylarch
so you can see all the modules in the environment. Then I show the output from pip install xraylarch
If you'd have a suggestion I'd be grateful!
Console
(xraylarch_env) C:\WINDOWS\system32>conda list
# packages in environment at C:\ProgramData\xraylarch\envs\xraylarch_env:
#
# Name Version Build Channel
brotli 1.1.0 hcfcfb64_1 conda-forge
brotli-bin 1.1.0 hcfcfb64_1 conda-forge
brotli-python 1.1.0 py311h12c1d0e_1 conda-forge
bzip2 1.0.8 h8ffe710_4 conda-forge
ca-certificates 2023.7.22 h56e8100_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
certifi 2023.7.22 pyhd8ed1ab_0 conda-forge
charset-normalizer 3.3.1 pyhd8ed1ab_0 conda-forge
colorama 0.4.6 pyhd8ed1ab_0 conda-forge
contourpy 1.1.1 py311h005e61a_1 conda-forge
cycler 0.12.1 pyhd8ed1ab_0 conda-forge
fonttools 4.43.1 py311ha68e1ae_0 conda-forge
freetype 2.12.1 hdaf720e_2 conda-forge
future 0.18.3 pyhd8ed1ab_0 conda-forge
gettext 0.21.1 h5728263_0 conda-forge
glib 2.78.0 h12be248_0 conda-forge
glib-tools 2.78.0 h12be248_0 conda-forge
gst-plugins-base 1.22.6 h001b923_2 conda-forge
gstreamer 1.22.6 hb4038d2_2 conda-forge
h5py 3.10.0 nompi_py311h0d04526_100 conda-forge
hdf5 1.14.2 nompi_h73e8ff5_100 conda-forge
icu 73.2 h63175ca_0 conda-forge
idna 3.4 pyhd8ed1ab_0 conda-forge
intel-openmp 2023.2.0 h57928b3_50497 conda-forge
joblib 1.3.2 pyhd8ed1ab_0 conda-forge
kiwisolver 1.4.5 py311h005e61a_1 conda-forge
krb5 1.21.2 heb0366b_0 conda-forge
latexcodec 2.0.1 pyh9f0ad1d_0 conda-forge
lcms2 2.15 h67d730c_3 conda-forge
lerc 4.0.0 h63175ca_0 conda-forge
libaec 1.1.2 h63175ca_1 conda-forge
libblas 3.9.0 19_win64_mkl conda-forge
libbrotlicommon 1.1.0 hcfcfb64_1 conda-forge
libbrotlidec 1.1.0 hcfcfb64_1 conda-forge
libbrotlienc 1.1.0 hcfcfb64_1 conda-forge
libcblas 3.9.0 19_win64_mkl conda-forge
libclang 15.0.7 default_h77d9078_3 conda-forge
libclang13 15.0.7 default_h77d9078_3 conda-forge
libcurl 8.4.0 hd5e4a3a_0 conda-forge
libdeflate 1.19 hcfcfb64_0 conda-forge
libffi 3.4.2 h8ffe710_5 conda-forge
libglib 2.78.0 he8f3873_0 conda-forge
libhwloc 2.9.3 default_haede6df_1009 conda-forge
libiconv 1.17 h8ffe710_0 conda-forge
libjpeg-turbo 3.0.0 hcfcfb64_1 conda-forge
liblapack 3.9.0 19_win64_mkl conda-forge
libogg 1.3.4 h8ffe710_1 conda-forge
libpng 1.6.39 h19919ed_0 conda-forge
libsqlite 3.43.2 hcfcfb64_0 conda-forge
libssh2 1.11.0 h7dfc565_0 conda-forge
libtiff 4.6.0 h6e2ebb7_2 conda-forge
libvorbis 1.3.7 h0e60522_0 conda-forge
libwebp-base 1.3.2 hcfcfb64_0 conda-forge
libxcb 1.15 hcd874cb_0 conda-forge
libxml2 2.11.5 hc3477c8_1 conda-forge
libzlib 1.2.13 hcfcfb64_5 conda-forge
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gmp 6.1.0 2 conda-forge
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
matplotlib 3.8.0 py311h1ea47a8_2 conda-forge
matplotlib-base 3.8.0 py311h6e989c2_2 conda-forge
mkl 2023.2.0 h6a75c08_50496 conda-forge
monty 2023.9.25 pyhd8ed1ab_0 conda-forge
mpmath 1.3.0 pyhd8ed1ab_0 conda-forge
msys2-conda-epoch 20160418 1 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
networkx 3.2.1 pyhd8ed1ab_0 conda-forge
numpy 1.26.0 py311h0b4df5a_0 conda-forge
openjpeg 2.5.0 h3d672ee_3 conda-forge
openssl 3.1.4 hcfcfb64_0 conda-forge
packaging 23.2 pyhd8ed1ab_0 conda-forge
palettable 3.3.3 pyhd8ed1ab_0 conda-forge
pandas 2.1.2 py311hf63dbb6_0 conda-forge
pathlib2 2.3.7.post1 py311h1ea47a8_3 conda-forge
pcre2 10.40 h17e33f8_0 conda-forge
pillow 10.1.0 py311h4dd8a23_0 conda-forge
pip 23.3.1 pyhd8ed1ab_0 conda-forge
plotly 5.18.0 pyhd8ed1ab_0 conda-forge
ply 3.11 py_1 conda-forge
pthread-stubs 0.4 hcd874cb_1001 conda-forge
pthreads-win32 2.9.1 hfa6e2cd_3 conda-forge
pybtex 0.24.0 pyhd8ed1ab_2 conda-forge
pymatgen 2023.10.11 py311h59ca53f_0 conda-forge
pyparsing 3.1.1 pyhd8ed1ab_0 conda-forge
pyqt 5.15.9 py311h125bc19_5 conda-forge
pyqt5-sip 12.12.2 py311h12c1d0e_5 conda-forge
pysocks 1.7.1 pyh0701188_6 conda-forge
python 3.11.5 he1021f5_0
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge
python_abi 3.11 2_cp311 conda-forge
pytz 2023.3.post1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0.1 py311ha68e1ae_1 conda-forge
qt-main 5.15.8 h9e85ed6_17 conda-forge
requests 2.31.0 pyhd8ed1ab_0 conda-forge
ruamel.yaml 0.18.3 py311ha68e1ae_0 conda-forge
ruamel.yaml.clib 0.2.7 py311ha68e1ae_2 conda-forge
scipy 1.11.3 py311h0b4df5a_1 conda-forge
setuptools 68.2.2 pyhd8ed1ab_0 conda-forge
sip 6.7.12 py311h12c1d0e_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
spglib 2.0.2 py311h59ca53f_0 conda-forge
sqlite 3.43.2 hcfcfb64_0 conda-forge
sympy 1.12 pyh04b8f61_3 conda-forge
tabulate 0.9.0 pyhd8ed1ab_1 conda-forge
tbb 2021.10.0 h91493d7_2 conda-forge
tenacity 8.2.3 pyhd8ed1ab_0 conda-forge
tk 8.6.13 hcfcfb64_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
tornado 6.3.3 py311ha68e1ae_1 conda-forge
tqdm 4.66.1 pyhd8ed1ab_0 conda-forge
tzdata 2023c h71feb2d_0 conda-forge
ucrt 10.0.22621.0 h57928b3_0 conda-forge
uncertainties 3.1.7 pyhd8ed1ab_0 conda-forge
urllib3 2.0.7 pyhd8ed1ab_0 conda-forge
vc 14.3 h64f974e_17 conda-forge
vc14_runtime 14.36.32532 hdcecf7f_17 conda-forge
vs2015_runtime 14.36.32532 h05e6639_17 conda-forge
wheel 0.41.2 pyhd8ed1ab_0 conda-forge
win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge
wxpython 4.2.1 py311h12c1d0e_0 conda-forge
xorg-libxau 1.0.11 hcd874cb_0 conda-forge
xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge
xz 5.4.2 h8cc25b3_0
yaml 0.2.5 h8ffe710_2 conda-forge
zlib 1.2.13 hcfcfb64_5 conda-forge
zstd 1.5.5 h12be248_0 conda-forge
(xraylarch_env) C:\WINDOWS\system32>pip install xraylarch
Traceback (most recent call last):
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Scripts\pip-script.py", line 5, in <module>
from pip._internal.cli.main import main
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\cli\main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\cli\main_parser.py", line 9, in <module>
from pip._internal.build_env import get_runnable_pip
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\build_env.py", line 19, in <module>
from pip._internal.cli.spinners import open_spinner
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\cli\spinners.py", line 9, in <module>
from pip._internal.utils.logging import get_indentation
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\utils\logging.py", line 29, in <module>
from pip._internal.utils.misc import ensure_dir
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\utils\misc.py", line 44, in <module>
from pip._internal.locations import get_major_minor_version
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\locations\__init__.py", line 14, in <module>
from . import _sysconfig
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\locations\_sysconfig.py", line 11, in <module>
from .base import change_root, get_major_minor_version, is_osx_framework
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\locations\base.py", line 9, in <module>
from pip._internal.utils import appdirs
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_internal\utils\appdirs.py", line 13, in <module>
from pip._vendor import platformdirs as _appdirs
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_vendor\platformdirs\__init__.py", line 46, in <module>
PlatformDirs = _set_platform_dir_class() #: Currently active platform
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_vendor\platformdirs\__init__.py", line 26, in _set_platform_dir_class
from pip._vendor.platformdirs.windows import Windows as Result
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\site-packages\pip\_vendor\platformdirs\windows.py", line 4, in <module>
import ctypes
File "C:\ProgramData\xraylarch\envs\xraylarch_env\Lib\ctypes\__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ImportError: DLL load failed while importing _ctypes: The specified module could not be found.
@lnaglecocco That seems like a pip problem. Did you try to diagnose that? Maybe check if you can pip install anything else - I would bet not.
It is OK if you want to not use the binary installers or installation scripts and instead install from the Python environment of your choice. But, if you do that, it is very hard for me to help you.
Hi @newville
Thanks for the advice. I actually tried installing the binary first, and I can use XAS Viewer for instance, but couldn't work out how to get the capability to run Larch from a python script that I could write in a text editor like Spyder or VisualStudio. Is there any online material explaining how to do this, or could you let me know how here?
I have managed to fix this by uninstalling Xraylarch and Anaconda and reinstalling. During Anaconda reinstall I clear package cache. Now I can use larch in Anaconda
Hi Larch community!
I have attempted to install Larch in Anaconda Prompt so that I can write Python scripts for XAS analysis, however the installation is failing. As advised on the website I ran the following lines in sequence:
However this did not successfully install Larch. I would be grateful if someone could help me identify the issue. At the end of this text I include a full transcript of the input/output in Anaconda Prompt, along with all the packages in the environment.
I have managed to install Larch using the binary file too, and this works for me in XAS Viewer but I've not managed to make this work with Anaconda (i.e running
import larch
in Jupyter and Spyder gives an error as the module is not found) - if it's possible to explain how I can make this work that would also solve my problem.Thanks in advance for your help!
Anaconda prompt transcript
All packages in environment
Here is what happens when I run
conda list
after this.