aburrell / apexpy

A Python wrapper for Apex coordinates
MIT License
34 stars 25 forks source link

BUG: Couldn't install apexpy on windows anaconda #110

Closed saigowtam14 closed 1 year ago

saigowtam14 commented 1 year ago

I couldn't install it on my anaconda environment. But I got an error on fortranapexpy. I did some google search, however, I did not find any answer. I am sure that I have installed GNU Fortran compiler in my system (I have been using it to compile my other Fortran codes). I copy pasted the error. I did not understand this.

Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [57 lines of output]

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

aburrell commented 1 year ago

Hi @saigowtam14 it looks like there is a problem with the version of python you have installed. The errors say Need python for 32-bit, but found 64-bit followed by ..\..\meson.build:51:0: ERROR: Python dependency not found. Everything that follows from that is consistent with an inconsistency between the python that was found and the mesonpy install.

Can you provide:

saigowtam14 commented 1 year ago

Hi,

Operating system: Windows 11 home NumPy version: 1.5.0 Python version: 3.9.15 (on Anaconda) meson 1.0.0 (https://pypi.org/project/meson/) command used: pip install apexpy

aburrell commented 1 year ago

That's a very old version of numpy, but probably isn't causing any issues (yet). Can you follow the instructions here and tell me whether your python is 32-bit or 64-bit? https://blog.finxter.com/python-version-bit-does-my-python-shell-run-32-bit-or-64-bit-version/

saigowtam14 commented 1 year ago

Python 3.9.15 (main, Nov 24 2022, 14:39:17) [MSC v.1916 64 bit (AMD64)] on win32

It seems my python version is 64 bit

import struct print(struct.calcsize("P") * 8) output is "64"

aburrell commented 1 year ago

Ok, that's your problem then. Since the compilers are 32 bit and your python is 64, they can't talk to each other to build and install apexpy. This link may be able to help you get 32-bit anaconda python: https://docs.anaconda.com/anaconda/install/hashes/win-3-32/

saigowtam14 commented 1 year ago

Okay. I changed my gfortran compiler to 64bit. Now, I can install apexpy and import it successfully.

Thank you!