点安装--target =. Alfred-Workflow出现错误 [英] Pip install --target=. Alfred-Workflow gives an error

查看:93
本文介绍了点安装--target =. Alfred-Workflow出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过这些说明在macOS上安装python库

I am trying to install a python library on macOS following through these instructions.

但是,每次运行此命令时,我都会出错:pip install --target=. Alfred-Workflow

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

我总是会因运行它而收到此错误:

And I always get this error for running 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 googling and searching for this but still can't figure it out. Thank you for any help.

推荐答案

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

有效:

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

重要提示:它会破坏常规的pip install命令,因此您需要随后rm ~/.pydistutils.cfg.

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

这篇关于点安装--target =. Alfred-Workflow出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆