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

On windows FindPython3.cmake will find global installs #196

Open
1 task done
tony-p opened this issue Sep 19, 2023 · 2 comments
Open
1 task done

On windows FindPython3.cmake will find global installs #196

tony-p opened this issue Sep 19, 2023 · 2 comments
Labels

Comments

@tony-p
Copy link

tony-p commented Sep 19, 2023

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

On windows if using python 3.10.* in the env and have python 3.11.* installed globally, no matter what I do (disabling managed aliases etc) FindPython3.cmake will find/prefer the global Python 3.11 install over the environment installed python 3.10 which eventually leads to package version conflicts in builds. The only thing that solves it is removing all global python installs.

Note I am using this within a pixi environment (https://prefix.dev/docs/pixi/overview) However I don't believe this would affect this behaviour

Installed packages

From pixi lock file

- name: cmake
  version: 3.27.4
  manager: conda
  platform: win-64
  dependencies:
    ucrt: '>=10.0.20348.0'
    vc14_runtime: '>=14.29.30139'
    vs2015_runtime: '*'
  url: https://conda.anaconda.org/conda-forge/win-64/cmake-3.27.4-h1537add_0.conda
  hash:
    md5: 4344adf2b563f4ffb36390ca26f0de18
    sha256: 813503025152a11f648ddc50a4716f5b6ddd3ea02a746ada6cc8a3f2cbaab2b6

- name: python
  version: 3.10.12
  manager: conda
  platform: win-64
  dependencies:
    bzip2: '>=1.0.8,<2.0a0'
    libffi: '>=3.4,<4.0a0'
    libsqlite: '>=3.42.0,<4.0a0'
    libzlib: '>=1.2.13,<1.3.0a0'
    openssl: '>=3.1.1,<4.0a0'
    tk: '>=8.6.12,<8.7.0a0'
    tzdata: '*'
    vc: '>=14.1,<15'
    vc14_runtime: '>=14.16.27033'
    xz: '>=5.2.6,<6.0a0'
  url: https://conda.anaconda.org/conda-forge/win-64/python-3.10.12-h4de0772_0_cpython.conda
  hash:
    md5: 14273454ca348a123ce09ab9d39c1a6e
    sha256: 02ee08f3f27488b76155535e43fc99ef491ccc21f28001c3cde9b134e8aa0b94

Environment info

$ pixi info
pixi 0.3.0

Platform            : win-64
Virtual packages    : __win=0=0
                    : __cuda=12.0=0
                    : __archspec=1=x86_64
Cache dir           : C:\Users\me\AppData\Local\rattler/cache
Auth storage        : C:\Users\me\.rattler

Project
------------

Manifest file       : C:\...\pixi.toml
Dependency count    : 16
Last updated        : 18-09-2023 11:21:36
Target platforms    : win-64
                    : linux-64
Tasks               : linter
                    : test
                    : build
                    : clean
                    : format
@tony-p tony-p added the bug label Sep 19, 2023
@Tobias-Fischer
Copy link
Contributor

We've had reports of this issue on both Linux and MacOS as well
RoboStack/robostack.github.io#27 (Linux; particular distributions only!)
RoboStack/robostack.github.io#35 MacOS (osx-arm64)

/cc @traversaro

@traversaro
Copy link
Contributor

On windows if using python 3.10.* in the env and have python 3.11.* installed globally, no matter what I do (disabling managed aliases etc) FindPython3.cmake will find/prefer the global Python 3.11 install over the environment installed python 3.10 which eventually leads to package version conflicts in builds.

The global Python3 is found even if you specify the Python3_EXECUTABLE location via -DPython3_EXECUTABLE=? Probably it may be worth to also try to set Python3_FIND_STRATEGY to LOCATION, see https://cmake.org/cmake/help/latest/module/FindPython3.html#hints . If you control the project you are building, making sure that policy CMP0094 is set to NEW, could also help.

Tobias-Fischer added a commit to RoboStack/vinca that referenced this issue Dec 19, 2023
Tobias-Fischer added a commit to RoboStack/vinca that referenced this issue Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants