pip3软件包安装在〜/ .local文件夹中

时间:2020-06-04 14:46:57

标签: pip python-3.8 path-variables ubuntu-20.04

我最近升级到ubuntu 20.04 LTS。预先安装python3.8时,我使用sudo apt install python3-pip命令安装了pip,然后开始安装python3库。我安装的所有库都将安装到~/.local/lib/Python3.8/site-packages文件夹中。如果我没记错的话,这些软件包应该安装在/usr/local/lib/python3.8/dist-packages中。

madhan@madhan:~$ pip3 show tensorflow
Name: tensorflow
Version: 2.2.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /home/madhan/.local/lib/python3.8/site-packages

安装软件包后,我收到警告,说$ PATH变量中不包含〜/ .local / bin。

Installing collected packages: appdirs, cachelib, pygments, cssselect, lxml, pyquery, howdoi
  WARNING: The script pygmentize is installed in '/home/madhan/.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 howdoi is installed in '/home/madhan/.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.
Successfully installed appdirs-1.4.4 cachelib-0.1 cssselect-1.1.0 howdoi-1.2.1 lxml-4.5.1 pygments-2.6.1 pyquery-1.4.1

即使$ PATH变量中不包含〜/ .local / bin,我仍然能够导入软件包。

madhan@madhan:~$ python3
Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> 

有人知道为什么会这样吗?如何更改安装pip3软件包的默认文件夹。可以将软件包放在〜/ .local文件夹中吗,还是将来会出现问题?

0 个答案:

没有答案