没有 sudo 无法在 conda 中安装 python wheel 文件

Cannot install python wheel file in conda without sudo

我正在尝试从 jetson nano 上的 .whl 文件构建 PyTorch。

我能够构建和安装该文件,但仅在使用 sudo 时,尝试 pip install 不使用 sudo 的文件导致此错误:

ERROR: torch-1.10.0a0+git36449ea-cp36-cp36m-linux_aarch64.whl is not a supported wheel on this platform.

这很奇怪,因为管理员我安装这个文件没有问题,但是我只能在进入之前使用 sudo 命令或 运行 python命令。

我应该注意到这是在 conda 环境中,但即使在基础 conda 环境中,这个问题仍然存在。

看来我也可以通过使用 conda deactivate 停用 conda 来安装软件包。

我在 conda 环境中使用 Python 3.7,在外部使用 Python 3.6。

I am using Python 3.7 in the conda environment and Python 3.6 outside.

这就是问题所在。你有一个 cp36 whl 文件,所以 python 3.6。我怀疑当你 运行 sudo pip 时,你的系统 pip 被调用,而当你 运行 pip 时,然后 pip 从你的 conda env 已被使用,无法将 python 3.6 whl 安装到 python 3.7 env.

您需要获取 cp37 whl 或创建一个安装了 python 3.6

的 conda env