Pip install --target=. Alfred-Workflow gives an error

耗尽温柔 提交于 2019-12-01 04:11:21
hansaplast

This question answers that (I found it when googling for the last line of your error message).

First I also got the same error message as you did, but after doing this:

$ echo "[install]
prefix=" > ~/.pydistutils.cfg

It works:

$ pip install --target=. Alfred-Workflow
Collecting Alfred-Workflow
Installing collected packages: Alfred-Workflow
Successfully installed Alfred-Workflow-1.24

Important note: it breaks normal pip install commands, so you need to rm ~/.pydistutils.cfg afterward.

I have a similar error installing python modules using pip with -t(--target) option.

The pip log show the next message:

Complete output from command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip-build-LvB_CW/xlrd/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-UNJizV-record/install-record.txt --single-version-externally-managed --compile --user --home=/tmp/tmphjBN23

and the next error:

can't combine user with prefix, exec_prefix/home, or install_(plat)base

Reading about alternate installation on python docs I see the next info

Note that the various alternate installation schemes are mutually exclusive: you can pass --user, or --home, or --prefix and --exec-prefix, or --install-base and --install-platbase, but you can’t mix from these groups.

So the command executed by pip has two mutually exclusive schemes --user and --home (i think it could be a bug on pip).

I use the --system option to avoid the error, eliminating the --user flag on the setup command.

pip install -t path_to_dir module_name --system

I don't known the aditional implications of this usage, but i think it's better than modifing the config file that messed up with normal installations.

PD: I use ubuntu 15.10 with pip 1.5.6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!