Closed nikfilippas closed 1 year ago
It could be that during the build, f90wrap uses numpy 1.23 (see https://github.com/jameskermode/f90wrap/blob/master/pyproject.toml#L12). The build environments can be separate from the installation environments, but these build systems are somewhat black magic to me.
Any ideas on how to work around this? I have previously managed to install pyhmcode
on another machine with no problem.
The installation is broken in weird ways for me too. What seems to be working for me right now is manually installing f90wrap
first (pip install f90wrap
). But I don't understand why that's working.
f90wrap
is already installed though. That's really odd...
Update: Turns out I had two versions of Numpy (v1.21 & v1.23) installed in parallel in my environment. One through conda
, and the other one was automatically installed with one of the pip-only supported packages. This caused f90wrap
to use the wrong version to build pyhmcode
, which in the end caused the problem on import.
I force-removed every trace of Numpy from my environment, re-installed Numpy v1.23 using the conda (mamba) installer, then f90wrap
, then pyhmcode
, and it is now working as intended. May I suggest considering releasing pyhmcode
on anaconda to completely avoid this issue in the future.
That might explain why it was suddenly working for me again too. I'll look into a conda package but I'm also considering just porting the relevant parts (HMCode, HMx) to python to avoid these headaches in the future.
As this package is not released on anaconda, I used my environment's
pip
to install it. It installs fine but it complains about anumpy
version mismatch on import:The two versions of
numpy
it is complaining about are 2 releases apart (one is v16 while the other one is v14?). Not sure if this is a phmcode-related problem, but no other modules complain about mynumpy
version (currently using1.21.5
). Unfortunately I can't update numpy becausenp.int
andnp.float
later go through their deprecation cycle and many of the other modules I use which rely on these will break.I don't think
pip
is picking up another version ofnumpy
while buildingpyhmcode
because there is only one version of it installed. Also,which pip
is/home/nick/anaconda/bin/pip
andnumpy.__path__
is['/home/nick/anaconda/lib/python3.9/site-packages/numpy']
.Force-reinstalling the latest version of
numpy
(the one which breaks other modules) doesn't work. Force-reinstalling1.21
doesn't work either. Removing every trace ofpyhmcode
and reinstalling doesn't work. Downloading and building fromsetup.py
usingpip
yields the same issue.