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

glibc version problem with virtualenv #13

Open
linuxrider opened this issue Feb 14, 2018 · 9 comments
Open

glibc version problem with virtualenv #13

linuxrider opened this issue Feb 14, 2018 · 9 comments

Comments

@linuxrider
Copy link

linuxrider commented Feb 14, 2018

When I use the snap version (2017.3.3 on Ubuntu 17.10) adding a existing virtualenv works flawlessly.
But not for the flatpak version (2017.3).
There the following dialog pops up:

Cannot set up a python SDK 
at Python 2.7 (python3.6.3-artful) (/home/jo/coding/envs/python3.6.3-artful/bin/python).
The SDK seems invalid.

In the log file:

STDOUT: 
STDERR: /home/jo/coding/envs/python3.6.3-artful/bin/python: /lib/libc.so.6: version `GLIBC_2.25' not found (required by /home/jo/coding/envs/python3.6.3-artful/bin/python)

	at com.jetbrains.python.sdk.PythonSdkType.getSysPathsFromScript(PythonSdkType.java:627)
	at com.jetbrains.python.sdk.PythonSdkType.getSysPath(PythonSdkType.java:610)
	at com.jetbrains.python.sdk.PythonSdkUpdater.evaluateSysPath(PythonSdkUpdater.java:426)
	at com.jetbrains.python.sdk.PythonSdkUpdater.getLocalSdkPaths(PythonSdkUpdater.java:297)
	at com.jetbrains.python.sdk.PythonSdkUpdater.updateLocalSdkPaths(PythonSdkUpdater.java:253)
	at com.jetbrains.python.sdk.PythonSdkUpdater.update(PythonSdkUpdater.java:136)
	at com.jetbrains.python.sdk.PythonSdkUpdater.updateOrShowError(PythonSdkUpdater.java:235)
	at com.jetbrains.python.sdk.PythonSdkType.setupSdkPaths(PythonSdkType.java:515)
	at com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil.setupSdk(SdkConfigurationUtil.java:151)
	at com.jetbrains.python.sdk.PySdkExtKt.setupAssociated(PySdkExt.kt:120)
	at com.jetbrains.python.sdk.add.PyAddExistingVirtualEnvPanel.getOrCreateSdk(PyAddExistingVirtualEnvPanel.kt:56)
	at com.jetbrains.python.sdk.add.PyAddSdkGroupPanel.getOrCreateSdk(PyAddSdkGroupPanel.kt:63)
	at com.jetbrains.python.sdk.add.PyAddSdkDialog.getOrCreateSdk(PyAddSdkDialog.kt:66)
	at com.jetbrains.python.sdk.PythonSdkDetailsStep.createLocalSdk(PythonSdkDetailsStep.java:117)
	at com.jetbrains.python.sdk.PythonSdkDetailsStep.optionSelected(PythonSdkDetailsStep.java:104)
	at com.jetbrains.python.sdk.PythonSdkDetailsStep.lambda$onChosen$0(PythonSdkDetailsStep.java:146)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:195)
	at com.intellij.ui.popup.AbstractPopup.lambda$null$7(AbstractPopup.java:1431)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
	at java.awt.Dialog.show(Dialog.java:1084)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:734)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:456)
	at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1696)
	at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1645)
	at com.intellij.openapi.options.newEditor.SettingsDialog.lambda$show$0(SettingsDialog.java:83)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153)
	at com.intellij.openapi.options.newEditor.SettingsDialog.show(SettingsDialog.java:83)
	at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:97)
	at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:63)
	at com.intellij.ide.actions.ShowSettingsAction.actionPerformed(ShowSettingsAction.java:52)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:321)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:911)
	at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:136)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:311)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:130)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
	at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:111)
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:120)
	at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:130)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:521)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:48)
	at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:541)
	at java.awt.Component.processMouseEvent(Component.java:6541)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6306)
	at java.awt.Container.processEvent(Container.java:2237)
	at java.awt.Component.dispatchEventImpl(Component.java:4897)
	at java.awt.Container.dispatchEventImpl(Container.java:2295)
	at java.awt.Component.dispatchEvent(Component.java:4719)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
	at java.awt.Container.dispatchEventImpl(Container.java:2281)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4719)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:737)
	at java.awt.EventQueue$4.run(EventQueue.java:735)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:646)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2018-02-14 06:21:22,736 [ 654947]  ERROR - ns.python.sdk.PythonSdkUpdater - PyCharm 2017.3  Build #PC-173.3727.137 
2018-02-14 06:21:22,736 [ 654947]  ERROR - ns.python.sdk.PythonSdkUpdater - JDK: 1.8.0_152-release 
2018-02-14 06:21:22,736 [ 654947]  ERROR - ns.python.sdk.PythonSdkUpdater - VM: OpenJDK 64-Bit Server VM 
2018-02-14 06:21:22,737 [ 654948]  ERROR - ns.python.sdk.PythonSdkUpdater - Vendor: JetBrains s.r.o 
2018-02-14 06:21:22,737 [ 654948]  ERROR - ns.python.sdk.PythonSdkUpdater - OS: Linux 
2018-02-14 06:21:22,737 [ 654948]  ERROR - ns.python.sdk.PythonSdkUpdater - Last Action: ShowSettings 
2018-02-14 06:21:22,826 [ 655037]   WARN - .python.run.PyVirtualEnvReader - Couldn't read shell environment: rv:1 text:0 out:python: /lib/libc.so.6: version `GLIBC_2.25' not found (required by python) 

The python 3.6.3 env is derived from the ubuntu system install.
Seems that python needs access to the systems glibc.
Could this be accomplished?

@TingPing
Copy link
Member

Seems that python needs access to the systems glibc.
Could this be accomplished?

No. Any virtual env just must be made in the sandbox not outside.

@linuxrider
Copy link
Author

So then it is needed to always create a virtualenv on the base of the python version of the related flatpak platform version?

@TingPing
Copy link
Member

Create it from within flatpak, either some graphical tool provided by Pycharm or from the cli: flatpak run --command=sh com.jetbrains.PyCharm-Community

@mhall119
Copy link

mhall119 commented Jul 7, 2018

I ran into this same problem. Using @TingPing's command above I was able to get a shell in the Flatpak, however virtualenv isn't installed in it so I had to do the following (inside the Flatpak shell):

  1. pip3 install --user virtualenv, the --user is required because you can't write to /usr/lib/ in the Flatpak
  2. ~/.local/bin/virtualenv --python3 ./env to create a virtualenv using the python3 installed in the Flatpak
  3. ./env/bin/pip install -r requirements to install my dependencies while still in the Flatpak shell

From there I was able to add the virtualenv to my PyCharm settings for my project

@mhall119
Copy link

mhall119 commented Jul 7, 2018

BTW, this is needed because /usr/bin/python that PyCharm can see inside the Flatpak environment is different from /usr/bin/python on your host, and it's built against a different version of glibc. A virtualenv created using the host's python won't necessarily be usable using the Flatpak's python.

I think that if the Flatpak were to include the virtualenv executable that PyCharm would be able to create a new virtualenv without problem. I've created issue #29 to do this.

@barthalion
Copy link
Member

@mhall119 Verified that it creates virtualenvs correctly now. Can we close the issue?

@mhall119
Copy link

I haven't actually verified this yet. I didn't rebuild the flatpak, but I'm assuming it will.

@Red-Eyed
Copy link

Red-Eyed commented Apr 1, 2020

You can use conda package manager and install any python version. it will contain libs and does not depend on system libs.

@baudm
Copy link

baudm commented Jun 21, 2020

I think all library-loading errors (i.e. "library not found") should be consolidated under #14.

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

6 participants