欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 能源 > 《python》在用户包下安装库出现权限报错

《python》在用户包下安装库出现权限报错

2024/11/30 18:46:41 来源:https://blog.csdn.net/weixin_72186894/article/details/139528679  浏览:    关键词:《python》在用户包下安装库出现权限报错

错误:

  WARNING: The scripts pyrsa-decrypt, pyrsa-encrypt, pyrsa-keygen, pyrsa-priv2pub, pyrsa-sign and pyrsa-verify are installed in '/home/lianlu/.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 coloredlogs is installed in '/home/lianlu/.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 randomname is installed in '/home/lianlu/.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 pykwalify is installed in '/home/lianlu/.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/lianlu/.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 jsonschema is installed in '/home/lianlu/.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 dask is installed in '/home/lianlu/.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 doesitcache is installed in '/home/lianlu/.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/lianlu/.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/lianlu/.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/lianlu/.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 rasa is installed in '/home/lianlu/.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.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
onnx-graphsurgeon 0.3.12 requires onnx, which is not installed.

问题原因:

这些警告信息表明您在Linux系统(特别是/home/lianlu用户目录下)使用pip安装了一些Python包,而这些包附带的可执行脚本安装到了/home/lianlu/.local/bin目录下。但是,您的系统PATH环境变量中没有包含这个目录,因此您不能直接在命令行通过这些脚本的名字来运行它们。

解决问题:

方法1:临时添加目录到PATH

每次打开终端时,如果需要使用这些脚本,可以手动将该目录添加到PATH中。可以在命令行中输入以下命令:

export PATH=$PATH:/home/lianlu/.local/bin

这样操作只会影响当前的终端会话。一旦关闭终端或打开新的终端窗口,就需要重新执行上述命令。

方法2:永久修改PATH环境变量

为了持久化这个设置,您可以将上述export命令添加到您的shell配置文件中。根据您使用的shell(通常是bash或者zsh),您需要编辑相应的配置文件。对于bash,通常是.bashrc.bash_profile;对于zsh,则是.zshrc

打开您的shell配置文件。例如,如果是bash,可以使用文本编辑器打开.bashrc

nano ~/.bashrc

在文件末尾添加以下行:

export PATH=$PATH:/home/lianlu/.local/bin

保存并关闭文件。

为了让改动生效,需要重新加载配置文件:

source ~/.bashrc

 或者如果是zsh,

source ~/.zshrc

这样设置后,每次打开终端时,/home/lianlu/.local/bin目录都会自动加入到PATH中,您就可以直接运行那些脚本了。

至于最后的错误信息,它指出pip的依赖解析器可能未考虑到所有已安装的包,导致依赖冲突。这可能是由于您安装的某个包与系统中其他地方安装的包版本不兼容。解决这种冲突通常需要确定具体冲突的包,然后可能需要卸载、更新或指定特定版本来重新安装相关的包。但首先确保PATH问题解决后,再尝试处理此依赖冲突,因为有时候环境变量设置不当也会间接导致这类错误信息出现。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com