Search code examples
pythonubuntupip

getting error why trying to dffml in development mode?


These are the commands i am running as mentioned in the documentation

git clone https://github.com/intel/dffml
cd dffml
python3 -m pip install -U pip setuptools wheel
python3 -m pip install --prefix=~/.local -e .[dev]

But i am getting warnings and error on the last command

warning

WARNING: Ignoring invalid distribution -jango (/home/dhruv/.local/lib/python3.8/site-packages)

error

    Found existing installation: Pillow 7.0.0
    Uninstalling Pillow-7.0.0:
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '_imagingtk.cpython-38-x86_64-linux-gnu.so'
Consider using the `--user` option or check the permissions.

And program stops executing after the error , i dont know what is the source of error and how to remove it, any help is appreciated


Solution

  • For the error, try using --user, like this:

    python3 -m pip install --user -e .[dev]
    

    Their docs talk about why they don't use --user, but the explanation doesn't make much sense to me.

    Installing to your home directory will reduce permissions issues. To do this we use the --prefix=~/.local flag. pip sometimes gets confused about the --user flag (and will blow up in your face if you try to pass it). So we use the --prefix=~/.local flag, which has the same effect but should always work.

    Specifically, I don't know why pip would "get confused", but I'm not an expert.