Closed saigowtam14 closed 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:
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
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/
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"
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/
Okay. I changed my gfortran compiler to 64bit. Now, I can install apexpy and import it successfully.
Thank you!
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]
meson setup --prefix=C:\ProgramData\Anaconda3\envs\lompe_env C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-install-0tu447fx\apexpy_4bae3750bd1e468f9c56f147625b46ef C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-install-0tu447fx\apexpy_4bae3750bd1e468f9c56f147625b46ef.mesonpy-kc9tks1f\build --native-file=C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-install-0tu447fx\apexpy_4bae3750bd1e468f9c56f147625b46ef.mesonpy-native-file.ini -Ddebug=false -Doptimization=2 The Meson build system Version: 0.64.1 Source dir: C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-install-0tu447fx\apexpy_4bae3750bd1e468f9c56f147625b46ef Build dir: C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-install-0tu447fx\apexpy_4bae3750bd1e468f9c56f147625b46ef.mesonpy-kc9tks1f\build Build type: native build Project name: apexpy Project version: 2.0.0 C compiler for the host machine: gcc (gcc 6.3.0 "gcc (MinGW.org GCC-6.3.0-1) 6.3.0") C linker for the host machine: gcc ld.bfd 2.28 Host machine cpu family: x86 Host machine cpu: x86 Fortran compiler for the host machine: gfortran (gcc 6.3.0 "GNU Fortran (MinGW.org GCC-6.3.0-1) 6.3.0") Fortran linker for the host machine: gfortran ld.bfd 2.28 Compiler for C supports arguments -Wno-unused-but-set-variable: YES Library m found: YES Program python found: YES (C:\ProgramData\Anaconda3\envs\lompe_env\python.exe) Need python for 32-bit, but found 64-bit
....\meson.build:51:0: ERROR: Python dependency not found
A full log can be found at C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-install-0tu447fx\apexpy_4bae3750bd1e468f9c56f147625b46ef.mesonpy-kc9tks1f\build\meson-logs\meson-log.txt Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\lompe_env\lib\site-packages\pip_vendor\pep517\in_process_in_process.py", line 144, in prepare_metadata_for_build_wheel hook = backend.prepare_metadata_for_build_wheel AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\lompe_env\lib\site-packages\pip_vendor\pep517\in_process_in_process.py", line 351, in
main()
File "C:\ProgramData\Anaconda3\envs\lompe_env\lib\site-packages\pip_vendor\pep517\in_process_in_process.py", line 333, in main
json_out['return_val'] = hook(*hook_input['kwargs'])
File "C:\ProgramData\Anaconda3\envs\lompe_env\lib\site-packages\pip_vendor\pep517\in_process_in_process.py", line 148, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-build-env-4jowkzcj\overlay\Lib\site-packages\mesonpy__init.py", line 1060, in build_wheel
with _project(config_settings) as project:
File "C:\ProgramData\Anaconda3\envs\lompe_env\lib\contextlib.py", line 135, in enter
return next(self.gen)
File "C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-build-env-4jowkzcj\overlay\Lib\site-packages\mesonpy__init__.py", line 975, in _project
with Project.with_temp_working_dir(
File "C:\ProgramData\Anaconda3\envs\lompe_env\lib\contextlib.py", line 135, in enter
return next(self.gen)
File "C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-build-env-4jowkzcj\overlay\Lib\site-packages\mesonpy\init.py", line 750, in with_temp_working_dir
yield cls(source_dir, tmpdir, build_dir, meson_args)
File "C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-build-env-4jowkzcj\overlay\Lib\site-packages\mesonpy\init.py", line 632, in init
self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
File "C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-build-env-4jowkzcj\overlay\Lib\site-packages\mesonpy\init__.py", line 680, in _configure
self._meson('setup', setup_args)
File "C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-build-env-4jowkzcj\overlay\Lib\site-packages\mesonpy__init.py", line 657, in _meson
return self._proc('meson', *args)
File "C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-build-env-4jowkzcj\overlay\Lib\site-packages\mesonpy\init__.py", line 652, in _proc
subprocess.check_call(list(args), env=self._env)
File "C:\ProgramData\Anaconda3\envs\lompe_env\lib\subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['meson', 'setup', '--prefix=C:\ProgramData\Anaconda3\envs\lompe_env', 'C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-install-0tu447fx\apexpy_4bae3750bd1e468f9c56f147625b46ef', 'C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-install-0tu447fx\apexpy_4bae3750bd1e468f9c56f147625b46ef\.mesonpy-kc9tks1f\build', '--native-file=C:\Users\SAI GOWTAM VALLURI\AppData\Local\Temp\pip-install-0tu447fx\apexpy_4bae3750bd1e468f9c56f147625b46ef\.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× 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.