Closed qianwu2 closed 1 year ago
I got this error message.
cosmic-qwM1-14:~ qwu$ python3 -m pip install apexpy Defaulting to user installation because normal site-packages is not writeable Collecting apexpy Using cached apexpy-2.0.1.tar.gz (328 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error
à Preparing metadata (pyproject.toml) did not run successfully.
â exit code: 1
â°â> [510 lines of output]
I got this issue resolved by installing the gfortran.
However, I am running into another issue.
When I run the code
from apexpy import Apex
I got this message.
from apexpy import Apex fortranapex module could not be imported. apexpy probably won't work. Failed with error: dlopen(/Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/fortranapex.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libgfortran.5.dylib Referenced from: <1751E3B6-F0EE-34F1-9E30-5AA60A68A965> /Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/fortranapex.cpython-39-darwin.so Reason: tried: '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file, not in dyld cache)/Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/apex.py:15: UserWarning: fortranapex module could not be imported, so apexpy probably won't work. Make sure you have a gfortran compiler. Failed with error: dlopen(/Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/fortranapex.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libgfortran.5.dylib Referenced from: <1751E3B6-F0EE-34F1-9E30-5AA60A68A965> /Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/fortranapex.cpython-39-darwin.so Reason: tried: '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file, not in dyld cache) warnings.warn("".join(["fortranapex module could not be imported, so ",
The lib is in a different directory.
/usr/local/gfortran/lib/libgfortran.5.dylib
Any easy solution?
Did you make sure you weren't using a combination of clang and gfortran? An example of how to make sure you're doing that correctly is in the docs here: https://apexpy.readthedocs.io/en/latest/installation.html#specifying-compilers
In Windows, you have to also install things in the correct order (developer tools, c, fortran, and then python). Hopefully that's not an issue on newer Macs, but I wanted to bring it up just in case, since the Mac OS is moving to emulate Windows more with every iteration.
Many thanks. Let me try that. Best, Qian
On Tue, Sep 19, 2023 at 8:40 AM Angeline Burrell @.***> wrote:
Did you make sure you weren't using a combination of clang and gfortran? An example of how to make sure you're doing that correctly is in the docs here: https://apexpy.readthedocs.io/en/latest/installation.html#specifying-compilers
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1725781229, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTA733LWML2UHKB554LX3GVGXANCNFSM6AAAAAA433ADKE . You are receiving this because you authored the thread.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
Hi Aburrell/Apexpy, Many thanks for your reply. Not sure who should I ask for help on this one.
cosmic-qwM1-14:bin qwu$ FC=/usr/local/gfortran/ CC=/usr/bin/gcc python3 -m build
On Tue, Sep 19, 2023 at 8:40 AM Angeline Burrell @.***> wrote:
Did you make sure you weren't using a combination of clang and gfortran? An example of how to make sure you're doing that correctly is in the docs here: https://apexpy.readthedocs.io/en/latest/installation.html#specifying-compilers
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1725781229, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTA733LWML2UHKB554LX3GVGXANCNFSM6AAAAAA433ADKE . You are receiving this because you authored the thread.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
Oh, that one’s easy! To run this you need to download the repository and be in the apexpy directory. There may be a way to use the CC/FC keys with pip, but I haven’t tried it. If it would work, the command would be something like:
qwu$ FC=/usr/local/gfortran/ CC=/usr/bin/gcc pip install apexpy
progress. I think there is a fix for this.
cosmic-qwM1-14:apexpy-main qwu$ FC=/usr/local/gfortran/bin/gfortran CC=/usr/local/gfortran/bin/gcc python3 -m build
apexpy 2.0.1
User defined options Native files: /Users/qwu/Downloads/apexpy-main/.mesonpy-hrztk8xr/meson-python-native-file.ini buildtype : release b_ndebug : if-release b_vscrt : md
Found ninja-1.11.1 at /opt/local/bin/ninja
ERROR Backend subprocess exited when trying to invoke build_sdist
On Tue, Sep 19, 2023 at 9:23 AM Angeline Burrell @.***> wrote:
Oh, that one’s easy! To run this you need to download the repository and be in the apexpy directory. There may be a way to use the CC/FC keys with pip, but I haven’t tried it. If it would work, the command would be something like:
qwu$ FC=/usr/local/gfortran/ CC=/usr/bin/gcc pip install apexpy
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1725882556, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTHQVDPCD27ZPKJXKDLX3G2F5ANCNFSM6AAAAAA433ADKE . You are receiving this because you authored the thread.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
This is a new one for me. It looks like it's trying to build from a source distribution instead of from the Git repository and currently that isn't supported. How did you get the apex-main
directory? Maybe try a clean build by removing any existing build
directories?
I downloaded it from Github.
Not sure this one will help. https://stackoverflow.com/questions/75312569/error-backend-subprocess-exited-when-trying-to-invoke-get-requires-for-build-sdi
On Tue, Sep 19, 2023 at 9:44 AM Angeline Burrell @.***> wrote:
This is a new one for me. It looks like it's trying to build from a source distribution instead of from the Git repository and currently that isn't supported. How did you get the apex-main directory? Maybe try a clean build by removing any existing build directories?
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1725921364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTFGW7CTJFT63GW5GZLX3G4W3ANCNFSM6AAAAAA433ADKE . You are receiving this because you authored the thread.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
No, that's for a broken pyproject.toml and it's working just fine on other systems. I just verified again that this command is working fine locally for me on Big Sur. It would be helpful if you filled out the form up top with all the requested information (python version, operating system, et cetera).
But it looks like you may have just forgotten to add the dot to the initial command:
FC=/usr/local/gfortran/bin/gfortran CC=/usr/local/gfortran/bin/gcc python3 -m build .
Tried with period as well. Same results.
Information updated.
If you do ls -a
in the apex-main directory do you see a .git
directory?
cosmic-qwM1-14:apexpy-main qwu$ ls -a . .gitignore CONTRIBUTING.rst dist setup.cfg .. .zenodo.json LICENSE docs setup.py .DS_Store AUTHORS.rst MANIFEST.in fortranapex .codeclimate.yml CHANGELOG.rst README.rst meson.build .github CODE_OF_CONDUCT.md apexpy pyproject.toml
On Tue, Sep 19, 2023 at 11:30 AM Angeline Burrell @.***> wrote:
If you do ls -a in the apex-main directory do you see a .git directory?
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1726192686, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTANO6NOEBFXHLRXP2DX3HJDJANCNFSM6AAAAAA433ADKE . You are receiving this because you authored the thread.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
So no. I was able to replicate your error by downloading the apexpy main repository using the zip file. I tried fixing it by adding an empty .git
directory, but that didn't work. It looks like Meson currently requires you to get the actual git repository instead of supporting the source distribution. This needs to be added to the documentation.
Try removing your apexpy-main
directory, and use git to retrieve the repository instead:
git clone https://github.com/aburrell/apexpy.git
Then re-try the build command.
Hi Aburrell/Apexpy, I got some warnings. in the build command.
Fortran 90 wrappers are saved to "./fortranapex-f2pywrappers2.f90"
[13/14] Compiling Fortran object fortranapex.cpython-39-darwin.so.p/meson-generated_.._fortranapex-f2pywrappers2.f90.o
fortranapex-f2pywrappers2.f90:287:10:
287 | use igrf, only : datel
| 1
Warning: Unused module variable âepochâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:287:10:
287 | use igrf, only : datel
| 1
Warning: Unused module variable âgtâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:287:10:
287 | use igrf, only : datel
| 1
Warning: Unused module variable âgyrâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:287:10:
287 | use igrf, only : datel
| 1
Warning: Unused module variable âhtâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:287:10:
287 | use igrf, only : datel
| 1
Warning: Unused module variable âhyrâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:287:10:
287 | use igrf, only : datel
| 1
Warning: Unused module variable ânmxeâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:978:10:
978 | use apxshmodule, only : nterm
| 1
Warning: Unused module variable âcoeff0â which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:978:10:
978 | use apxshmodule, only : nterm
| 1
Warning: Unused module variable âdpolynomqâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:978:10:
978 | use apxshmodule, only : nterm
| 1
Warning: Unused module variable âdxqdrhocoeffâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:978:10:
978 | use apxshmodule, only : nterm
| 1
Warning: Unused module variable âdyqdrhocoeffâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:978:10:
978 | use apxshmodule, only : nterm
| 1
Warning: Unused module variable âdzqdrhocoeffâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:978:10:
978 | use apxshmodule, only : nterm
| 1
Warning: Unused module variable âepochgridâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:978:10:
978 | use apxshmodule, only : nterm
| 1
Warning: Unused module variable âgcoeff0â which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:978:10:
978 | use apxshmodule, only : nterm
| 1
Warning: Unused module variable âpbarâ which has been explicitly imported at (1) [-Wunused-variable]
fortranapex-f2pywrappers2.f90:978:10:
978 | use apxshmodule, only : nterm
| 1
Then I did python3 -m pip install . (in the apexpy folder).
And I am having issue with fortranapex.
cosmic-qwM1-14:apexpy qwu$ python3 -m pip install . Defaulting to user installation because normal site-packages is not writeable Processing /Users/qwu/Downloads/apexpy Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy>=1.19.5 in /Users/qwu/Library/Python/3.9/lib/python/site-packages (from apexpy==2.0.1) (1.25.2) Building wheels for collected packages: apexpy Building wheel for apexpy (pyproject.toml) ... done Created wheel for apexpy: filename=apexpy-2.0.1-cp39-cp39-macosx_13_0_arm64.whl size=593731 sha256=e097cf53bc3760c34e9ba6a4ec10c0e2319f1ca2b89ee5db55ce39ee320ad5ea Stored in directory: /private/var/folders/zb/rxx_q0s1sz2qlt76nprh5k40007j/T/pip-ephem-wheel-cache-bg4b7veu/wheels/6d/5b/ee/b4ef3b13de997fa8d6b6b39b23bb51e5c962495c7c2272915f Successfully built apexpy Installing collected packages: apexpy Attempting uninstall: apexpy Found existing installation: apexpy 2.0.1 Uninstalling apexpy-2.0.1: Successfully uninstalled apexpy-2.0.1 Successfully installed apexpy-2.0.1
cosmic-qwM1-14:apexpy qwu$ python3 Python 3.9.6 (default, Sep 26 2022, 11:37:49) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from apexpy import Apex fortranapex module could not be imported. apexpy probably won't work. Failed with error: cannot import name 'fortranapex' from partially initialized module 'apexpy' (most likely due to a circular import) (/Users/qwu/Downloads/apexpy/apexpy/init.py)/Users/qwu/Downloads/apexpy/apexpy/apex.py:15: UserWarning: fortranapex module could not be imported, so apexpy probably won't work. Make sure you have a gfortran compiler. Failed with error: cannot import name 'fortranapex' from partially initialized module 'apexpy' (most likely due to a circular import) (/Users/qwu/Downloads/apexpy/apexpy/init.py) warnings.warn("".join(["fortranapex module could not be imported, so ",
On Tue, Sep 19, 2023 at 12:15 PM Angeline Burrell @.***> wrote:
So no. I was able to replicate your error by downloading the apexpy main repository using the zip file. I tried fixing it by adding an empty .git directory, but that didn't work. It looks like Meson currently requires you to get the actual git repository instead of supporting the source distribution. This needs to be added to the documentation.
Try removing your apexpy-main directory, and use git to retrieve the repository instead: git clone https://github.com/aburrell/apexpy.git
Then re-try the build command.
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1726255764, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTGN4IUNJHNGPMHN2V3X3HONFANCNFSM6AAAAAA433ADKE . You are receiving this because you authored the thread.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
Oh, make sure you aren't in the apexpy directory when you start python. It will try to use the local code instead of the installed package. This is ok when you have pure-Python packages, but doesn't work with Fortran wrappers.
From a different directory. cosmic-qwM1-14:~ qwu$ python3 Python 3.9.6 (default, Sep 26 2022, 11:37:49) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from apexpy import Apex fortranapex module could not be imported. apexpy probably won't work. Failed with error: dlopen(/Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/fortranapex.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libgfortran.5.dylib Referenced from: <1751E3B6-F0EE-34F1-9E30-5AA60A68A965> /Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/fortranapex.cpython-39-darwin.so Reason: tried: '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file, not in dyld cache)/Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/apex.py:15: UserWarning: fortranapex module could not be imported, so apexpy probably won't work. Make sure you have a gfortran compiler. Failed with error: dlopen(/Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/fortranapex.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libgfortran.5.dylib Referenced from: <1751E3B6-F0EE-34F1-9E30-5AA60A68A965> /Users/qwu/Library/Python/3.9/lib/python/site-packages/apexpy/fortranapex.cpython-39-darwin.so Reason: tried: '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file, not in dyld cache) warnings.warn("".join(["fortranapex module could not be imported, so ",
This may be an issue with your fortran installation: https://stackoverflow.com/questions/57207357/dyld-library-not-loaded-usr-local-gfortran-lib-libgfortran-3-dylib-reason-im
For earlier mac, The lib is in /usr/local/lib For this mac m2 pro gfortran puts the lib in /usr/local/gfortran/lib. I cannot make a folder in /usr/local named lib to put the file in.
On Tue, Sep 19, 2023 at 12:50 PM Angeline Burrell @.***> wrote:
This may be an issue with your fortran installation: https://stackoverflow.com/questions/57207357/dyld-library-not-loaded-usr-local-gfortran-lib-libgfortran-3-dylib-reason-im
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1726303908, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTE2KV5NNSJXYJVGS5LX3HSN7ANCNFSM6AAAAAA433ADKE . You are receiving this because you authored the thread.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
There must be a way to get around this, but it's a gfortran installation issue and I don't have access to a version of your operating system.
Hi @qianwu2, I just installed this on a mac m2 pro chip under Ventura to help debug things. The test code on the readme is working. I've installed gcc through brew.
I've tried to duplicate the system parameters to the best of my ability, but the main difference is I am using gcc 13.2.0. (I'm also using Ventura 13.5.2). How are you installing gfortran?
Hi Jeff, Many thanks for your help. I got the gcc from gnu website. I have another gcc pre-installed. I am not sure gcc is the problem, it seems gfortran (I downloaded installation package from gnu as well) is the problem. The package placed the lib in /usr/local/gfortran/lib. not at /usr/local/lib. Wondering is your gfortran lib at?
Best, Qian
On Wed, Sep 20, 2023 at 8:54 AM Jeff Klenzing @.***> wrote:
Hi @qianwu2 https://github.com/qianwu2, I just installed this on a mac m2 pro chip under Ventura to help debug things. The test code on the readme is working. I've installed gcc through brew.
I've tried to duplicate the system parameters to the best of my ability, but the one difference is I am using gcc 13.2.0. How are you installing gfortran?
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1727893090, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTGETJLAXBFE62M6RWDX3L7RBANCNFSM6AAAAAA433ADKE . You are receiving this because you were mentioned.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
Hi Jeff, I am thinking try brew install gfortran and gcc. I am wondering if you could let me know how you install these compilers?
On Wed, Sep 20, 2023 at 8:54 AM Jeff Klenzing @.***> wrote:
Hi @qianwu2 https://github.com/qianwu2, I just installed this on a mac m2 pro chip under Ventura to help debug things. The test code on the readme is working. I've installed gcc through brew.
I've tried to duplicate the system parameters to the best of my ability, but the one difference is I am using gcc 13.2.0. How are you installing gfortran?
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1727893090, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTGETJLAXBFE62M6RWDX3L7RBANCNFSM6AAAAAA433ADKE . You are receiving this because you were mentioned.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
gfortran is in /opt/homebrew/bin/gfortran
I think brew installs this as part of gcc. Interestingly, mac still defaults to the clang version of gcc (/usr/bin/gcc)
I've had issues with installing gfortran separately in the past for other fortran installs. Have you tried adding the new location to your path?
Hi Jeff, I am thinking try brew install gfortran and gcc. I am wondering if you could let me know how you install these compilers?
You can get brew from https://brew.sh/
It's basically just a ruby install. If you go through the command line, it will print to screen a few commands to update your path. Just make sue to run those afterward. You can then run brew install gcc
, which installs gfortran as well
Hi, I made a folder in /usr/local called lib and copied /usr/local/gfortran/lib over use sudo cp -r /usr/local/gfortran/lib . That seems to make the apexpy happy. It is working now. Many thanks for your help.
On Wed, Sep 20, 2023 at 10:42 AM Jeff Klenzing @.***> wrote:
Hi Jeff, I am thinking try brew install gfortran and gcc. I am wondering if you could let me know how you install these compilers?
You can get brew from https://brew.sh/
It's basically just a ruby install. If you go through the command line, it will print to screen a few commands to update your path. Just make sue to run those afterward. You can then run brew install gcc, which installs gfortran as well
— Reply to this email directly, view it on GitHub https://github.com/aburrell/apexpy/issues/126#issuecomment-1728095206, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBNSTFHLC3RSYSMOTFSVFDX3MMGVANCNFSM6AAAAAA433ADKE . You are receiving this because you were mentioned.Message ID: @.***>
-- Qian Wu High Altitude Observatory National Center for Atmospheric Research P.O.Box 3000 Boulder, Co 80307-3000 (303) 497 2176 (303) 497 2180
Describe the problem or ask the question
A clear and concise description of what the problem or question is.
Provide an example, if applicable
Steps to reproduce the behavior:
Expectations
A clear and concise description of what you expected (or wanted) to happen.
Screenshots
If applicable, add screenshots to help explain your question.
Computer
Please complete the following information:
Additional context
Add any other context about the problem here.