Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.4.3 distributions for Mac Silicon and Noarch? #24

Open
matthewcarbone opened this issue May 11, 2024 · 5 comments
Open

v1.4.3 distributions for Mac Silicon and Noarch? #24

matthewcarbone opened this issue May 11, 2024 · 5 comments

Comments

@matthewcarbone
Copy link

Hi there,

It looks like the latest version, v1.4.3, is not available for Mac Silicon and noarch. Are there plans for this release? I seemingly cannot use this code due to the following error in v1.4.0 (which I'm not actually sure is due to v1.4.0 or not):

$ conda create -n py3.10-Local-Structure-Modeling python=3.10 -y
$ conda activate py3.10-Local-Structure-Modeling
$ conda install -c conda-forge diffpy.pdffit2
$ pip install ipython

$ ipython

In [1]: from diffpy.pdffit2 import PdfFit

---------------------------------------------------------------------------

ImportError                               Traceback (most recent call last)
Cell In[1], line 1

----> 1 from diffpy.pdffit2 import PdfFit

File ~/miniforge3/envs/py3.10-Local-Structure-Modeling/lib/python3.10/site-packages/diffpy/pdffit2/__init__.py:25
     16 """PDFfit2 - real space structure refinement program.
     17 Classes:
     18     PdfFit
     19 Routines:
     20     redirect_stdout
     21 """
     24 from diffpy.pdffit2.version import __version__, __date__
---> 25 from diffpy.pdffit2.pdffit import PdfFit
     26 from diffpy.pdffit2.output import redirect_stdout
     27 from diffpy.pdffit2.pdffit2 import is_element

File ~/miniforge3/envs/py3.10-Local-Structure-Modeling/lib/python3.10/site-packages/diffpy/pdffit2/pdffit.py:29
     23 import six
     25 # Load pdffit2 and output modules to the current namespace.
     26 # Note that "import diffpy.pdffit2.output as output" would
     27 # crash with AttributeError when executed during imports of
     28 # parent packages.
---> 29 from diffpy.pdffit2 import pdffit2
     30 from diffpy.pdffit2 import output
     32 # helper routines

ImportError: cannot import name 'pdffit2' from partially initialized module 'diffpy.pdffit2' (most likely due to a circular import) (/Users/mc/miniforge3/envs/py3.10-Local-Structure-Modeling/lib/python3.10/site-packages/diffpy/pdffit2/__init__.py)

Any help would be appreciated! Thanks!

@sbillinge
Copy link
Contributor

Thanks Matt. We do have plans to do the Mac releases. We have been working through our releases redoing them without setup.py and we didn't get to this yet, but I think the urgency is increasing, especially with the workaround for M2 chips apparently not working for M3:



CONDA_SUBDIR=osx-64 conda create -n pdfgui2 python=3.9

conda activate pdfgui2

conda config --env --set subdir osx-64

conda install -c conda-forge diffpy.pdfgui

pdfgui

This uses Rosetta to run the osx-64 code on the arm architecture, but we do need a native ARM build

@matthewcarbone
Copy link
Author

@sbillinge thanks, Simon! For now I can probably just use a container to make it work.

@matthewcarbone
Copy link
Author

@sbillinge in the meantime do you have any advice here? I really want to get this code working, even in a clean Docker container, but the v1.4.0 installation via conda appears to just not work due to this circular import error. Thanks in advance for your help.

@matthewcarbone
Copy link
Author

I did ultimately get this working (v1.4.3) in a Docker container. Here's the instructions for Ubuntu 22.04 if it's helpful for you or anyone else. I've also included a few other quality of life installs here:

# Download base image ubuntu 22.04
FROM ubuntu:22.04

# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive

# Install essentials
RUN apt -y update
RUN apt -y install aptitude
RUN aptitude -y install vim
RUN aptitude -y install wget
RUN aptitude -y install curl
RUN aptitude -y install build-essential
RUN aptitude -y install libgsl-dev

# Install miniconda on Linux
RUN mkdir -p ~/miniconda3
ARG ARCHITECTURE=aarch64
RUN wget "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-${ARCHITECTURE}.sh" -O ~/miniconda3/miniconda.sh

# Initialize miniconda
RUN bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
RUN rm -rf ~/miniconda3/miniconda.sh
RUN ~/miniconda3/bin/conda init bash
RUN ~/miniconda3/bin/conda init zsh

# Now install diffpy.pdffit2
# note that this requires the manual installation of gcc via build-essential
# and gsl via libgsl-dev
ARG PIP=/root/miniconda3/bin/pip
RUN "${PIP}" install "diffpy.pdffit2==1.4.3"

RUN rm -rf /var/lib/apt/lists/*

@sbillinge
Copy link
Contributor

sbillinge commented May 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants