17

When I install a local python package with pip 21.1 (pip install .)I get a deprecation warning:

 DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.

I do not understand what what means. Also, how can I fix it?

0

4 Answers 4

10

In short, my understanding:

  • pip builds a tree of dependencies between packages.
  • currently pip requires a temporary folder
  • this leads sometimes to issues, especially if relative paths are involved, see here.

To fix this and additional issues. they will change the behaviour of pip install. So to test if that will affect you in any way you can test it before by using --use-feature=in-tree-build as described by @Jason Harrison.

As mentioned in the warning there is a github discussion which explains it in much more detail here.

3
  • So no action required from my side. It is just an internal change, not visible to the user?
    – Alex
    Commented Apr 28, 2021 at 14:17
  • 1
    If anyone has infromation otherwise, please let us know, but as far as i understand it, yes you are right. In case you want to be super sure e.g. for production, use the --use-feature=in-tree-build for your packages.
    – Andreas
    Commented Apr 28, 2021 at 14:21
  • You can add use-feature = in-tree-build to the [install] section of your ~/.configs/pip/pip.conf file. Not sure if this has any bad consequences, but has worked for me.
    – mforbes
    Commented Jan 27, 2022 at 18:37
8

While the answer by @andreas links to the discussions and answers the question. The way to use the flag is to include it after the target:

pip install . --use-feature=in-tree-build

This is the "same" as using the --editable flag: the source of the package is used as the source of the installation without any copies being made. This is extra useful when your working copy of the repository has large extra debugging or binary files lying around that would need to be copied to a temporary location.

0

Deprecated means that the package is no longer being maintained or the current package version is outdated (at least from my experience). As far as I know, there is no way to fix this other than reaching out to the developer to update the code to use a different or updated version of the said package.

0

Use this:

pip show celery
pip3 install --upgrade celery
pip3 show celery
1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jun 7 at 7:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.