首页 > 解决方案 > 在 POP!_os 中将 Tensorflow 添加到 PATH 时出错(类似于 Ubuntu)

问题描述

我不确定如何解决这个问题,因为我对 POP!_os 和 Linux 很陌生。我想将 TensorFlow 安装到我的 Pycharm IDE,但收到一条很长的错误消息,告诉我将一堆目录添加到 PATH。运行后出现此错误pip install TensorFlow-gpu

    WARNING: The scripts pyrsa-decrypt, pyrsa-encrypt, pyrsa-keygen, pyrsa-priv2pub, pyrsa-sign and pyrsa-verify are installed in '/home/trkornman/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script wheel is installed in '/home/trkornman/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script markdown_py is installed in '/home/trkornman/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script google-oauthlib-tool is installed in '/home/trkornman/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script tensorboard is installed in '/home/trkornman/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts estimator_ckpt_converter, import_pb_to_tensorboard, saved_model_cli, tensorboard, tf_upgrade_v2, tflite_convert, toco and toco_from_protos are installed in '/home/trkornman/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

我想知道是否有这个命令,或者我是否必须手动移动它们,如果是这样,我可以在我的文件资源管理器中找到 PATH 。

标签: pythonlinuxtensorflowubuntu

解决方案


您需要添加~/.local/bin到您的PATH. 你可以通过设置PATH~/.profile喜欢的来做到这一点

在您的主目录中打开一个名为.profile. 如果它不存在,请使用您喜欢的任何文本编辑器创建它。

nano ~/.profile

走到最后并添加这个

PATH="$HOME"/.local/bin:"$PATH"

如果$HOME未定义(echo $HOME应该显示您的主目录)尝试用您的用户名替换它

PATH=/home/trkornman/.local/bin:"$PATH"

之后您需要重新启动/重新登录才能工作。


推荐阅读