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

I am trying to install the python library on macOS after these instructions .

However, I get an error every time I run this command: pip install --target=. Alfred-Workflow pip install --target=. Alfred-Workflow

And I always get this error to run it:

 pip install --target=. Alfred-Workflow Collecting Alfred-Workflow Installing collected packages: Alfred-Workflow Exception: Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install **kwargs File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 247, in move_wheel_files prefix=prefix, File "/usr/local/lib/python2.7/site-packages/pip/locations.py", line 153, in distutils_scheme i.finalize_options() File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 264, in finalize_options "must supply either home or prefix/exec-prefix -- not both" DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both 

I tried a google search and searched for it, but still can't figure it out. Thanks for any help.

+4
python macos alfred
Jan 13 '17 at 18:11
source share
2 answers

This question answers this question (I found it when searching in line for the last line of your error message).

At first I received the same error message as you, but after that:

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

Works:

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

Important note : it interrupts the usual pip install commands, so you need rm ~/.pydistutils.cfg after.

+10
Jan 13 '17 at 20:42 on
source share

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

The following message appears in the pip log:

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

and the following error:

cannot combine user with prefix, exec_prefix / home or install_ (plat) base

Read about alternative installation in python docs. I see the following information

Please note that the different alternative installation schemes are mutually exclusive: you can pass --user or --home or --prefix and --exec-prefix, or --install-base and --install-platbase, but you cannot move from these groups.

So, the pip command has two mutually exclusive schemes - the user and - home (I think this might be a bug in pip).

I use the - system option to avoid the error by excluding the -ser flag in the configuration command.

pip install -t path_to_dir module_name --system

I do not know the additional consequences of this use, but I think this is better than changing the configuration file, which is messed up with the usual settings.

PD: I use ubuntu 15.10 with pip 1.5.6

+1
Aug 10 '17 at 23:41
source share



All Articles