dyld:未加载库:/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Python [英] dyld: Library not loaded: /usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Python

查看:107
本文介绍了dyld:未加载库:/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试通过pycharm运行简单的python3代码时,出现以下错误

When trying to run simple python3 code via pycharm, I get following error

/Users/slimerski/PycharmProjects/studia/venv/bin/python/Users/slimerski/PycharmProjects/studia/zadania_14.pydyld:未加载库:/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Python引用自:/Users/slimerski/PycharmProjects/studia/venv/bin/python原因:找不到图片

/Users/slimerski/PycharmProjects/studia/venv/bin/python /Users/slimerski/PycharmProjects/studia/zadania_14.py dyld: Library not loaded: /usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Python Referenced from: /Users/slimerski/PycharmProjects/studia/venv/bin/python Reason: image not found

以退出代码134(被信号6:SIGABRT中断)结束的过程

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

一切正常,直到最近我已经通过brew安装了zsh并更新了xcode.我尝试使用 otool -L exefile 修复它,但出现另一个错误

Everything was working until recently I have installed zsh and updated xcode via brew. I have tried fixing it with otool -L exefile but instead I get another error

/Library/Developer/CommandLineTools/usr/bin/objdump:错误:'exefile':没有这样的文件或目录.

/Library/Developer/CommandLineTools/usr/bin/objdump: error: 'exefile': No such file or directory.

反正有解决办法吗?

推荐答案

我认为您的环境变量路径可能是问题所在.如果您最近升级到MacOS catalina,则需要执行以下操作:

I think your environmental variable path may be the problem. If you recently upgraded to MacOS catalina you need to do this:

1,使用此命令检查当前变量设置为什么.

1, use this command to check what your current variables are set to.

$ env

我的看起来像这样:(注意PATH一词,因为会列出一长串的环境变量详细信息)

mine looks like this: (lookout for the word PATH, as there will be a long list of environmental variable details)

PATH=/Users/.../dev/venv/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin

2,接下来要做的是将路径写入./zshrc文件.

2, what you want to do next is write your path into a ./zshrc file.

$ vi ~/.zshrc

将您先前复制的PATH粘贴到该位置.每个人都会有所不同.

Paste the PATH you copied earlier into this location. It will be different for everyone.

它应该看起来像这样:

export PATH="/Users/.../dev/venv/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:$PATH"

3,保存文件并退出vi.我假设所有人都知道,但是如果您不知道:按 ESC 键,然后输入:-

3, save your file and exit vi. I assume everyone knows but if you don't: Press the ESC key then type in:-

:wq!

这将保存文件并退出vi

this will save the file and exit vi

4,激活您的文件

$ . ~/.zshrc

您的python程序现在应该可以正常运行了.

your python programs should run without a problem now.

这篇关于dyld:未加载库:/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆