简体   繁体   English

解决 PyCharm python 错误 - dyld: 库未加载

[英]Resolving PyCharm python error - dyld: Library not loaded

I am using PyCharm 2018.3.2 Community Edition, under macOS Sierra V. 10.12.6我在 macOS Sierra V. 10.12.6 下使用 PyCharm 2018.3.2 社区版

Today I found the following error message in Python-Console:今天我在 Python-Console 中发现以下错误信息:

dyld: Library not loaded: /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/Python
  Referenced from: /Users/tleis/PycharmProjects/BioInformaticsI/venv/bin/python
  Reason: image not found

After some research, I doubt the reason is due to some commands I run related to HomeBrew.经过一番研究,我怀疑原因是由于我运行的一些与 HomeBrew 相关的命令。

The error message smells like you've probably updated your Python version, which can occasionally break virtualenvs with those symptoms.错误消息听起来像是您可能更新了 Python 版本,这有时会因这些症状而破坏 virtualenv。

The easiest fix is to just delete and recreate the virtualenv.最简单的解决方法是删除并重新创建 virtualenv。

I had the same issue, and as AKX says, deleting and recreating the virtualenv solved it.我遇到了同样的问题,正如 AKX 所说,删除并重新创建 virtualenv 解决了它。 For those who, like me, weren't sure exactly how to do this, these commands did the trick for me:对于那些像我一样不确定如何执行此操作的人,这些命令对我有用:

$ find ~/.virtualenvs/env-name/ -type l -delete
$ virtualenv ~/.virtualenvs/env-name

Replace "env-name" with the name of the virtual environment in question.将“env-name”替换为相关虚拟环境的名称。 The path displayed in the error message should show you what the virtualenv name is.错误消息中显示的路径应该显示 virtualenv 名称是什么。

The same issue occured with me and I tried to change the project interpreter in the PyCharm IDE as shown below.我也出现了同样的问题,我尝试更改 PyCharm IDE 中的项目解释器,如下所示。

When there are multiple versions of Python present in your system, the IDE has to interpret the updated reference as it is in usr/local/bin/python {version}当系统中存在多个 Python 版本时,IDE 必须像在usr/local/bin/python {version} 中一样解释更新的引用

在此处输入图片说明

Just create a new virtual environment, by creating a new project.只需通过创建一个新项目来创建一个新的虚拟环境。 This is mostly because you ran a Python upgrade or did a unlink and re link of the python binaries.这主要是因为您运行了 Python 升级或对 Python 二进制文件进行了取消链接和重新链接。 Also it helps if you can check at once without IDE , in the terminal if the program is working or not.如果您可以在没有 IDE 的情况下在终端中立即检查程序是否正常工作,这也很有帮助。 Creating a new Virtual environment worked for me !!创建一个新的虚拟环境对我有用!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MacOS 上的 Python“dyld:库未加载”- 错误 - Python on MacOS "dyld: Library not loaded" - error 由于dyld而运行sphinx时出错:库未加载:@ rpath / Python - error running sphinx due to dyld: Library not loaded: @rpath/Python 如何解决dyld:Myo的python包装器中的库未加载错误 - How to solve dyld: Library not loaded error in a python wrapper for a Myo dyld:库未加载:@executable_path/../.Python - dyld: Library not loaded: @executable_path/../.Python virtualenv中引发的错误-dyld:未加载库:/Library/Frameworks/Python.framework/Versions/3.4/Python - error raised in virtualenv - dyld: Library not loaded: /Library/Frameworks/Python.framework/Versions/3.4/Python macOS Big Sur 更新后 python3.5 错误“未加载 dyld 库:CoreFoundation” - python3.5 error 'dyld library not loaded: CoreFoundation' after macOS Big Sur update AWS SAM CLI 全新安装引发错误 - dyld:未加载库:@executable_path/../.Python - AWS SAM CLI Fresh install throws error - dyld: Library not loaded: @executable_path/../.Python Numpy 库未在 Pycharm 中解析 - Numpy library not resolving in Pycharm `dyld:Library not loaded`错误阻止virtualenv加载 - `dyld: Library not loaded` error preventing virtualenv from loading 如何解决“dyld:库未加载:@executable_path ..”错误 - How to resolve "dyld: Library not loaded: @executable_path.." error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM