Is it possible to get pip to print the configuration it is using?

前端 未结 3 2016
遇见更好的自我
遇见更好的自我 2020-12-29 18:13

Is there any way to get pip to print the config it will attempt to use? For debugging purposes it would be very nice to know that:

  1. config.ini files are in the
3条回答
  •  执念已碎
    2020-12-29 18:40

    From how I see it, your question can be interpreted in three ways:

    1. What is the configuration of the pip executable?

    There is a quite extensive documentation for the configurations supported by pip, see here: https://pip.pypa.io/en/stable/user_guide/#configuration

    1. What is the configuration that pip uses when configuring and subsequently building code required by a Python module?

    This is specified by the package that is being installed. The package maintainer is responsible for producing a configuration script. For example, Numpy has a Configuration class (https://github.com/numpy/numpy/blob/master/numpy/distutils/misc_util.py) that they use to configure their Cython build.

    1. What are the current modules installed with pip so I can reproduce a specific environment configuration?

    This is easy, pip freeze > requirements.txt. This will produce a file of all currently installed pip modules along with their exact versions. You can then do pip install -r requirements.txt to reproduce that exact environment configuration on another machine.

    I hope this helps.

提交回复
热议问题