Closed mkhorton closed 4 years ago
Btw, I'm not sure what the "on certain systems" issue is, but if it's related to libstdc++ no longer being included on Mac, there's a solution to this:
https://github.com/pandas-dev/pandas/blob/8e4424fbcfc98d23085ddbcf8765946bc85da035/setup.py#L477
@mkhorton I haven't gotten a chance to test the latest updates on Mac yet. Let me work on it and I will get back to you very soon
No worries, happy to help too if I can. Github Actions is a nice way to do cross-platform testing, you can write a single test which is just installing p2ptrans and run it in a matrix of OSs [Windows, macOS, Ubuntu, etc.] and flag if there's an error.
Forgot to add that I was using gfortran 9.2.0 for compilation.
@mkhorton I was not able to reproduce your problem. I tested the installation and p2ptrans --help
on Sierra and on Mojave without any issue.
Mojave 10.14.5 gfortran 9.2.0 make 3.16.3 python 3.8.2
What steps did you take exactly? Are you installing in a virtual environment, a conda environment, using --user
or system wide? It seems like you were installing a particular commit, did you use the -e
option? is the local bin folder in your PATH?
Gfortran via homebrew, in a fresh conda environment as listed above. Installed dependencies (starting numpy), initially tried a “python setup.py develop” but also then tried installing directly from the git repo instead (as listed in your README).
On Tue, Mar 3, 2020 at 08:48, Félix Therrien notifications@github.com wrote:
@mkhorton https://github.com/mkhorton I was not able to reproduce your problem. I tested the installation and p2ptrans --help on Sierra and on Mojave without any issue.
Mojave 10.14.5 gfortran 9.2.0 make 3.16.3 python 3.8.2
What steps did you take exactly? Are you installing in a virtual environment, a conda environment, using --user or system wide? It seems like you were installing a particular commit, did you use the -e option? is the local bin folder in your PATH?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ftherrien/p2ptrans/issues/8?email_source=notifications&email_token=AAWWWRBB5IOGFR7YR57Y2D3RFUYGDA5CNFSM4K67PBBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENUH6NI#issuecomment-594050869, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWWWRENRINRBEFYGNDW2WLRFUYGDANCNFSM4K67PBBA .
@mkhorton If I understand correctly, the installation is successful but the program fails when you try to run it. Is that correct?
Note:
python setup.py develop
will not use PEP517 and it should fail (in a fresh conda envrionment with no site-packages) because it can't import numpy. Is that what happened at first? Try using pip install .
instead making sure pip is upgraded to at least version 19.0, then you won't need to install numpy first.
After the installation completes. What happens if you try to import p2ptrans in python? e.g.python -c "import p2ptrans"
If that works fine, what is the first line in the file p2ptrans
located in your conda environment's bin?
e.g. head -1 $(which p2ptrans)
Yes, that's correct, I get a segfault and Python itself crashes.
Is that what happened at first?
Yeah, I made sure to install all requirements first.
What happens if you try to import p2ptrans in python?
The same error.
python -c "import p2ptrans"' terminated by signal SIGSEGV (Address boundary error)
which p2ptrans
gives /usr/local/miniconda3/envs/p2ptrans/bin/p2ptrans
@mkhorton I think I was able to reproduce the error! I get it only when using a conda environment on MacOS.
It seems like pip failed to build the wheel but was still able to finish installing anyway:
fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
Do you see that somewhere in your install output? Anyway, if that is the correct error then this is the same as this issue: https://github.com/hmmlearn/hmmlearn/issues/43 and this:
CFLAGS="-I $(python -c "import numpy; print(numpy.get_include())") $CFLAGS" pip install git+https://github.com/ftherrien/p2ptrans
should solve it.
Frustratingly, still seeing the error, despite claiming the wheel built successfully:
> CFLAGS="-I /usr/local/miniconda3/envs/p2ptrans/lib/python3.7/site-packages/numpy/core/include $CFLAGS" pip install git+https://github.com/ftherrien/p2ptrans
...
Building wheels for collected packages: p2ptrans
Building wheel for p2ptrans (PEP 517) ... done
Created wheel for p2ptrans: filename=p2ptrans-0.0-cp37-cp37m-macosx_10_9_x86_64.whl size=178484 sha256=f635a896230c61321d7cc83bd26ca5d9fc2653f29dd060a925985906bfab0d65
Stored in directory: /private/var/folders/m5/nj63sfvd3n91h2783hqp37_40000gn/T/pip-ephem-wheel-cache-bh9axhpg/wheels/ae/19/b0/e27c11384d777b9817c52bc01551e8a4a045242d8e5011c325
Successfully built p2ptrans
Installing collected packages: p2ptrans
Successfully installed p2ptrans-0.0
> p2ptrans --help
'p2ptrans --help' terminated by signal SIGSEGV (Address boundary error)
However, your intuition about this being a conda issue seems to be correct -- I installed via a clean virtualenv and it seems to work fine :-) Why conda is presenting a problem I'm not sure.
Ah! Yes you are right! In my excitement I did not try the actual faulty p2ptrans --help
. The problem is with the pylada installation not with p2ptrans. There is an open issue about this here: https://github.com/pylada/pylada-light/issues/42. The problem occurs specifically with conda on MacOS. There does not seem to be a solution yet...
Ah ok, thanks for the info! What aspects of pylada does p2ptrans depend upon?
It depends on multiple functions and classes of pylada...
Ok here is a solution: (in a fresh conda env)
pip install git+https://github.com/pylada/pylada-light.git@scikit
pip install git+https://github.com/ftherrien/p2ptrans
I can confirm that works!! Also just noting the setup.py has pylada
not pylada-light
, I'm not sure if this makes any practical difference. I wonder if pre-built wheels on PyPI would avoid this issue?
pylada-light is just the name of the repo, the package name is pylada. Of course putting both pylada and p2ptrans on PyPl would probably be better! See #9
I've just merged a branch in pylada that builds pylada with scikit-build. It also tests macos + conda via a github action. So now it should be sufficient to do pip install git+https://github.com/ftherrien/p2ptrans
alone.
@mdavezac Thank you so much!
'p2ptrans --help' terminated by signal SIGSEGV (Address boundary error)
Tried both
CXXFLAGS="-std=c++11" pip install git+https://github.com/ftherrien/p2ptrans
andpip install git+https://github.com/ftherrien/p2ptrans
pip freeze
:and Python 3.7.6 on macOS 10.15.2