英文:
VS Code cannot find python libpython3.10.so
问题
I am trying to select a vritual environment as the default interpreter for python in vs code, but this fails. In the terminal I can, without issues run
在尝试将虚拟环境选择为 VS Code 中的 Python 默认解释器时出现问题。在终端中,我可以轻松运行以下命令:
$ <venv_path>/python
Python 3.10.8 (main, Mar 14 2023, 20:30:44) [GCC 12.2.0] on linux
Type "help", "copyright", "credits", or "license" for more information.
或者
which python
<venv_path>/python
after the environment has been activated. Furthermore, in the terminal, I can see that
此外,在终端中,我可以看到
echo $LD_LIBRARY_PATH
...:/opt/<...>/lib/:...
which means that the libraries can be found from the terminal so the python can run. Now the problem. When I try to select <venv_path>/python
as the interpreter for the opened project, this fails with an error message. In the output window I see the following:
这意味着库可以从终端中找到,因此 Python 可以运行。现在问题出现了。当我尝试将 <venv_path>/python
选择为打开项目的解释器时,出现错误消息。在输出窗口中,我看到以下内容:
[Error: Command failed: <venv_path>/python -I /<...>/.vscode-server/extensions/ms-python.python-2023.6.0/pythonFiles/get_output_via_markers.py /<...>/.vscode-server/extensions/ms-python.python-2023.6.0/pythonFiles/interpreterInfo.py <br>
<venv_path>/python: error while loading shared libraries: libpython3.10.so.1.0: cannot open shared object file: No such file or directory
Which means that vs code was not able to find the library. Why is that and how can I fixt that?
这意味着 VS Code 无法找到库。为什么会发生这种情况,我该如何修复它?
英文:
I am trying to select a vritual environment as the default interpreter for python in vs code, but this fails. In the terminal I can, without issues run
$ <venv_path>/python
Python 3.10.8 (main, Mar 14 2023, 20:30:44) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
or
which python
<venv_path>/python
after the environment has been activated. Furthermore, in the terminal, I can see that
echo $LD_LIBRARY_PATH
...:/opt/<...>/lib/:...
which means that the libraries can be found from the terminal so the python can run. Now the problem. When I try to select <venv_path>/python
as the interpreter for the opened project, this fails with an error message. In the output window I see the following:
> [Error: Command failed: <venv_path>/python -I /<...>/.vscode-server/extensions/ms-python.python-2023.6.0/pythonFiles/get_output_via_markers.py /<...>/.vscode-server/extensions/ms-python.python-2023.6.0/pythonFiles/interpreterInfo.py <br>
> <venv_path>/python: error while loading shared libraries: libpython3.10.so.1.0: cannot open shared object file: No such file or directory
Which means that vs code was not able to find the library. Why is that and how can I fixt that?
答案1
得分: 0
问题出现在一个HPC集群上,事实证明,总是有一些后台进程仍然在我的帐户上活动。快速执行 "killall -u
英文:
As it turned out (this problem occured on an HPC cluster) there was always some backgroud process still active for my account. A quick killall -u <username> everything running in my name. After logging back in with ssh the problem was resolved.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论