CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
72 stars 69 forks source link

New version could not find Python Anaconda #470

Closed potassium-chloride closed 9 months ago

potassium-chloride commented 9 months ago

Dear developers,

I have problems installing CRPropa on my system System Information: (Please fill out the following information)

Did you install CRPropa from git or download a release? I installed version 3.2.1-77-g3498d825 from git cloning.

Things that I tried before asking for help: I read and followed the installation instructions at https://crpropa.github.io/CRPropa3/ . Before writing this request I have installed previous version of CRPropa 3.2.1-no-git without problems. Today I receive the following output:

  Could NOT find Python (missing: Python_LIBRARIES Python_INCLUDE_DIRS
  Python_NumPy_INCLUDE_DIRS Development NumPy) (found suitable version
  "3.9.5", minimum required is "3.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindPython/Support.cmake:2214 (find_package_handle_standard_args)
  /usr/share/cmake-3.16/Modules/FindPython.cmake:304 (include)
  CMakeLists.txt:448 (find_package)

But I have Python+NumPy and successfully installed previous version. Previous version o CMakeLists.txt used lines:

find_package(PythonLibs)

New version uses line: find_package(Python 3.0 REQUIRED COMPONENTS Interpreter Development NumPy)

I tried putting -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DPYTHON_EXECUTABLE=$(which python) -DCMAKE_PREFIX_PATH=$CONDA_PREFIX after cmake command but there is no effect.

Cmake found python at /usr/bin/python3.9, but I always use Anaconda. How to fix it?

rafaelab commented 9 months ago

The CMake Python finder understands Python_EXECUTABLE but not PYTHON_EXECUTABLE.

potassium-chloride commented 9 months ago

Thanks a lot! It helped. I confused because previous version understands PYTHON_EXECUTABLE.

rafaelab commented 9 months ago

Thanks, @potassium-chloride . The documentation will be amended following your question, with pull request #471