简体   繁体   English

如何判断我的 Python 安装是否“捆绑”?

[英]How can I tell if my Python Installation is "bundled"?

I'm installing a package (cx_Oracle), and the documentation says:我正在安装 package (cx_Oracle), 文档说:

Make sure you are not using the bundled Python.确保您没有使用捆绑的 Python。 This has restricted entitlements and will fail to load Oracle client libraries.这具有受限制的权利,并且将无法加载 Oracle 客户端库。

I'm wondering: how do I tell if my Python installation (if I did not install it) is "bundled" or not?我想知道:我如何判断我的 Python 安装(如果我没有安装)是否“捆绑”?

My best guess comes from a line further down the docs我最好的猜测来自文档下方的一行

On macOS, make sure you are not using the bundled Python (use Homebrew or Python.org instead).在 macOS 上,确保您没有使用捆绑的 Python(改用 Homebrew 或 Python.org)。 If you are not using init_oracle_client(), then put the Oracle Instant Client libraries in ~/lib or /usr/local/lib.如果您没有使用 init_oracle_client(),则将 Oracle Instant Client 库放在 ~/lib 或 /usr/local/lib 中。

Perhaps they mean the Python version that comes bundled with the operating system?也许他们的意思是与操作系统捆绑在一起的 Python 版本?

Normally in MAC OS python comes along with installation of OS itself that means python package included in OS files also called as bundled python.通常在 MAC OS 中 python 伴随着 OS 本身的安装,这意味着 python package 包含在 OS 文件中,也称为捆绑 Z23EEEB79EE47BDD26BDDZ6。 You can check if the python you are using is bundled or not by您可以检查您使用的 python 是否被捆绑

which python

On mac os you should get output like if it's a bundled python在 mac os 上,你应该得到 output 就像它是捆绑的 python

/usr/bin/python

when you want to get the path of externally installed python by当您想通过以下方式获取外部安装 python 的路径时

which python3

The only difference is When you type唯一的区别是当你输入

python 

in terminal it launches pre-installed or bundled python.在终端中,它启动预安装或捆绑的 python。 If you type如果你输入

python3 

in terminal it launches externally installed python in this cases what the oracle documentation is recommended在终端中,它启动外部安装的 python 在这种情况下推荐 oracle 文档

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

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