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

error with pyenv virtualenv: The SDK seems invalid #112

Open
ClonedOne opened this issue Feb 8, 2021 · 1 comment
Open

error with pyenv virtualenv: The SDK seems invalid #112

ClonedOne opened this issue Feb 8, 2021 · 1 comment

Comments

@ClonedOne
Copy link

ClonedOne commented Feb 8, 2021

I am experiencing a problem with pycharm when trying to select as interpreter a python bin created through a pyenv virtualenv.

Cannot set up a python SDK 
at Python 3.10 (remote_maax) ($HOME/.pyenv/versions/remote_maax/bin/python).
The SDK seems invalid.

I am not using python 3.10, the virtualenv has been created with python 3.8.5. The virtualenv works when activated manually from the shell with pyenv activate, I can pip install packages and use them correcly.

I am on a new install of pop os 20.10 (ubuntu), kernel 5.8.0-7642-generic, pyenv 1.2.22, pycharm community 2020.3.3 installed via flatpak.

Launching pycharm from the shell I get:

com.jetbrains.python.sdk.InvalidSdkException: Failed to determine Python's sys.path value:
STDOUT: 
STDERR: /home/gio/.pyenv/versions/remote_maax/bin/python3.8: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/gio/.pyenv/versions/remote_maax/bin/python3.8)

    at com.jetbrains.python.sdk.PythonSdkType.getSysPathsFromScript(PythonSdkType.java:457)
    at com.jetbrains.python.sdk.PythonSdkType.getSysPath(PythonSdkType.java:439)
    at com.jetbrains.python.sdk.PythonSdkUpdater.evaluateSysPath(PythonSdkUpdater.java:576)
    at com.jetbrains.python.sdk.PythonSdkUpdater.getLocalSdkPaths(PythonSdkUpdater.java:436)
    at com.jetbrains.python.sdk.PythonSdkUpdater.updateLocalSdkPaths(PythonSdkUpdater.java:400)
    at com.jetbrains.python.sdk.PythonSdkUpdater.updateLocalSdkVersionAndPaths(PythonSdkUpdater.java:370)
    at com.jetbrains.python.sdk.PythonSdkUpdater.lambda$updateVersionAndPathsSynchronouslyAndScheduleRemaining$0(PythonSdkUpdater.java:267)
    at com.intellij.openapi.progress.impl.CoreProgressManager$1.run(CoreProgressManager.java:275)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
    at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:520)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:79)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:834)

I do have libc 2.32 installed:

glibc-source/groovy,groovy,now 2.32-0ubuntu3 all [installed]
  GNU C Library: sources

libc6/groovy,now 2.32-0ubuntu3 amd64 [installed]
  GNU C Library: Shared libraries

I am posting this here because I have tried doing the same operation with pycharm community downloaded from JetBrains' website (the tarball), and that version works correctly with the same pyenv virtualenv.

Please let me know if I can provide more info to identify the issue

@dotneutron
Copy link

I think this is related to #14. @baudm provided what appears to be a fix, although I haven't tried it yet. The problem is due to flatpak's sandboxed nature, as I understand it.

I'm essentially in the same situation, I installed 3.7.10 using pyenv and created a local virtual environment using venv.

You should be able to create a new virtual environment using what I believe is the flatpak's bundled Python version - 3.7.4, but it's not really a solution.

Python 3.7.4 (default, Nov 10 2011, 15:00:00) 
[GCC 9.3.0] on linux

I'm also on glibc 2.32 but the flatpak's bundled glibc seems to be 2.30.

# Run from inside PyCharm's Python Console.
>>> import os; os.system("ldd --version")
ldd (GNU libc) 2.30

It's been mentioned before, but perhaps this is why snap allows the --classic flag for confinement, but flatpak may have different goals in mind. PyCharm (or any IDE for that matter) requires a little more wiggle room.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants