简体   繁体   English

在 MacOS Big Sur 上安装 Python3.4 时出错

[英]Python3.4 installation erroring out on MacOS Big Sur

After installing python 3.4.3 and on running the command python3.4, it gives an error:安装 python 3.4.3 并运行命令 python3.4 后,出现错误:

dyld: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.4/Resources/Python.app/Contents/MacOS/Python
  Reason: image not found

I found a solution to the above problem.我找到了解决上述问题的方法。 It can be done using pyenv manager installed using brew instead of using default pkg installer.可以使用使用 brew 安装的 pyenv 管理器来完成,而不是使用默认的 pkg 安装程序。

You might face few errors in that too like: implicit declaration of function 'getentropy' is invalid in C99您可能也会遇到一些错误,例如: implicit declaration of function 'getentropy' is invalid in C99

Those errors can be avoided by using a patch.使用补丁可以避免这些错误。 Patch link 补丁链接

Following this entire link should help you in getting Python 3.4.x running in BigSur.遵循整个链接应该可以帮助您在 BigSur 中运行 Python 3.4.x。

(2022 update) The patch isn't enough, as explained later in the thread . (2022 年更新)补丁是不够的,如线程后面所述。 Instead:反而:

  1. Save the updated patch locally.在本地保存更新的补丁

  2. Run the following 2 commands:运行以下 2 个命令:

brew uninstall --ignore-dependencies --force openssl冲泡卸载 --ignore-dependencies --force openssl

brew reinstall zlib brew重新安装zlib

  1. Replace Python-3.4.3-macos.patch with the path to your saved patch, and run:Python-3.4.3-macos.patch替换为您保存的补丁的路径,然后运行:
 CPPFLAGS="-I/usr/local/opt/zlib/include -I$(brew --prefix readline)/include" LDFLAGS="-L$(brew --prefix readline)/lib -L/usr/local/opt/zlib/lib" pyenv install 3.4.3 --patch < Python-3.4.3-macos.patch

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM