question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CMake PythonLibs picking up wrong version

See original GitHub issue

Describe the bug

When

- uses: actions/setup-python@v2
  with:
    python-version: 3.8.x
    architecture: x64

CMake seems to get the correct PythonInterp but the wrong PythonLibs. I wanted version 3.8.7 for both.

– Found PythonLibs: C:/hostedtoolcache/windows/Python/3.9.1/x64/libs/python39.lib (found suitable version “3.9.1”, minimum required is “3.0”) – Found PythonInterp: C:/hostedtoolcache/windows/Python/3.8.7/x64/python.exe (found suitable version “3.8.7”, minimum required is “3.0”)

Which version of the action are you using?

  • v1
  • v2
  • Some other tag (such as v2.0.1 or master)

Environment

  • self-hosted
  • Linux
  • Windows
  • Mac

If applicable, please specify if you’re using a container

Python Versions Please list all of the effected versions of Python (3.8.2, etc.) 3.8 and 3.9

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Run/Repo Url If applicable, and if your repo/run is public, please include a URL so it is easier for us to investigate.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vlad-nncommented, Jan 12, 2022

@nikita-bykov, thank you so much for your help! Very appreciated.

1reaction
pjb7687commented, Feb 9, 2021

To be clear: I am using MSYS2 shell. I solved my problem by manually adding the python executable to PATH:

export PATH=`cygpath "${pythonLocation}"`:$PATH

After that CMake finds the right one. This might not be relevant to the OP’s problem but might be helpful for others having the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cmake finds wrong python libs - Stack Overflow
This works as long as my python script isn't using any modules installed into the site-packages directory, otherwise I get an ImportError. This ......
Read more >
CMAKE python version mismatch? - ROOT Forum
Dear Experrs, I am using ROOT 6.23/01 form cmvfs dev3/nightlies slot: ... proper Python/PythonLibs find_program(ROOT_CONFIG_EXECUTABLE NAMES ...
Read more >
Wrong python library gets linked against when finding boost ...
Wrong python library gets linked against when finding boost library `numpy3`. I recently updated CMake from 3.10 to 3.11.1 on my arch machine....
Read more >
[CMake] CMake finds the wrong Python interpreter on Windows
[CMake] CMake finds the wrong Python interpreter on Windows ... find_package(PythonLibs) >>>> >>>> Using CMake 2.6.4 (or CMake 2.8), ...
Read more >
252277 – cmake find_package(python3...) fails to get default ...
will get the wrong version. At least when more than one python version is installed. The old method using find_package(PythonInterp .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found