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

Failed to install with pip install mceq #29

Closed
HDembinski opened this issue Feb 12, 2021 · 3 comments · Fixed by #32
Closed

Failed to install with pip install mceq #29

HDembinski opened this issue Feb 12, 2021 · 3 comments · Fixed by #32
Assignees

Comments

@HDembinski
Copy link
Contributor

I haven't looked into MCEq for a while and I am pleased to see the nice documentation with a simple example. The difference between 1.1 and 1.2 regarding muon number look very exciting.

I tried to do pip install mceq to play with it, but I got a failure about a missing header:

    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tl/pv6mt7z17tz0stm1fjfg01cc0000gn/T/pip-install-hwqakdud/mceq/setup.py'"'"'; __file__='"'"'/private/var/folders/tl/pv6mt7z17tz0stm1fjfg01cc0000gn/T/pip-install-hwqakdud/mceq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tl/pv6mt7z17tz0stm1fjfg01cc0000gn/T/pip-record-gy26ubhg/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/mceq
         cwd: /private/var/folders/tl/pv6mt7z17tz0stm1fjfg01cc0000gn/T/pip-install-hwqakdud/mceq/
    Complete output (45 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.15-x86_64-3.9
    copying mceq_config.py -> build/lib.macosx-10.15-x86_64-3.9
    creating build/lib.macosx-10.15-x86_64-3.9/MCEq
    copying MCEq/particlemanager.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq
    copying MCEq/misc.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq
    copying MCEq/version.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq
    copying MCEq/__init__.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq
    copying MCEq/core.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq
    copying MCEq/solvers.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq
    copying MCEq/charm_models.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq
    copying MCEq/data.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq
    package init file 'MCEq/tests/__init__.py' not found (or not a regular file)
    creating build/lib.macosx-10.15-x86_64-3.9/MCEq/tests
    copying MCEq/tests/test_mceq.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/tests
    copying MCEq/tests/test_msis.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/tests
    copying MCEq/tests/test_densities.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/tests
    creating build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry
    copying MCEq/geometry/__init__.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry
    copying MCEq/geometry/nrlmsise00_mceq.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry
    copying MCEq/geometry/geometry.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry
    copying MCEq/geometry/density_profiles.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry
    creating build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry/nrlmsise00
    copying MCEq/geometry/nrlmsise00/__init__.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry/nrlmsise00
    copying MCEq/geometry/nrlmsise00/nrlmsise00.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry/nrlmsise00
    creating build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry/corsikaatm
    copying MCEq/geometry/corsikaatm/corsikaatm.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry/corsikaatm
    copying MCEq/geometry/corsikaatm/__init__.py -> build/lib.macosx-10.15-x86_64-3.9/MCEq/geometry/corsikaatm
    creating build/lib.macosx-10.15-x86_64-3.9/MCEq/data
    copying MCEq/data/README.md -> build/lib.macosx-10.15-x86_64-3.9/MCEq/data
    running build_ext
    building 'MCEq.geometry.nrlmsise00.libnrlmsise00' extension
    creating build/temp.macosx-10.15-x86_64-3.9
    creating build/temp.macosx-10.15-x86_64-3.9/MCEq
    creating build/temp.macosx-10.15-x86_64-3.9/MCEq/geometry
    creating build/temp.macosx-10.15-x86_64-3.9/MCEq/geometry/nrlmsise00
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -IMCEq/geometry/nrlmsise00 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@3.9/3.9.0_2/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c MCEq/geometry/nrlmsise00/nrlmsise-00.c -o build/temp.macosx-10.15-x86_64-3.9/MCEq/geometry/nrlmsise00/nrlmsise-00.o
    MCEq/geometry/nrlmsise00/nrlmsise-00.c:23:10: fatal error: 'nrlmsise-00.h' file not found
    #include "nrlmsise-00.h"   /* header for nrlmsise-00.h */
             ^~~~~~~~~~~~~~~
    1 error generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tl/pv6mt7z17tz0stm1fjfg01cc0000gn/T/pip-install-hwqakdud/mceq/setup.py'"'"'; __file__='"'"'/private/var/folders/tl/pv6mt7z17tz0stm1fjfg01cc0000gn/T/pip-install-hwqakdud/mceq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tl/pv6mt7z17tz0stm1fjfg01cc0000gn/T/pip-record-gy26ubhg/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/mceq Check the logs for full command output.
@HDembinski
Copy link
Contributor Author

HDembinski commented Feb 12, 2021

If you have some time, I would recommend to set up cross-platform building of the binary wheels for mceq, so that pip install mceq is guaranteed to work (as it installs the binary). With cibuildwheels and GitHub actions it is not so hard anymore, but it is not easy either. You could have a look at how it is done for iminuit
https://github.com/scikit-hep/iminuit/blob/develop/.github/workflows/wheels.yml
Most of that is boiler plate. You need to make sure that the build works in all the images that cibuildwheel offers (which requires some try-and-error), but if it is set up once, it works great.

@cescalara
Copy link

Yo, I'm also getting this exact issue when pip installing with Python 3.9. Python 3.8 still works fine.

@afedynitch
Copy link
Collaborator

Hi! Sorry for replying late.

The issue is that binaries for 3.9 are not yet built because there were some dependencies were coming without binaries on some of the build platforms. This should be fixed now, as 3.9 becomes more popular. Why pip install throughs the error is simply because I forgot to include the header files in the setup.py and the source dist is incomplete.

For the time being please clone the repo and install with pip install -e. There should be no issues with 3.9.

@afedynitch afedynitch self-assigned this Apr 6, 2021
@afedynitch afedynitch linked a pull request Jul 2, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants