How to install a module for all users with pip on linux?

后端 未结 4 1813
走了就别回头了
走了就别回头了 2020-12-25 10:12

How to install a package in the standard python environment i.e. /usr/local/lib/python2.7/dist-packages using pip and make this new packag

4条回答
  •  既然无缘
    2020-12-25 10:35

    Use the --target option when calling pip

    pip install --target=/your/pyinstalldir loremipsum
    

    The target directory must be a location writable by your user.

    Note that this requires the regular user environment has the target directory present in the sys.path. One possible way to achieve that is by using the PYTHONPATH env var:

    # /etc/profile.d/myenvvars.sh
    export PYTHONPATH=/your/pyinstalldir
    

提交回复
热议问题