当前位置:  开发笔记 > 编程语言 > 正文

点子安装--target =.Alfred-Workflow给出了一个错误

如何解决《点子安装--target=.Alfred-Workflow给出了一个错误》经验,为你挑选了1个好方法。

我试图通过这些说明在macOS上安装python库.

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

我总是得到这个错误来运行它:

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

我试着谷歌搜索并搜索这个,但仍然无法弄明白.感谢您的任何帮助.



1> hansaplast..:

这个问题回答了(我在谷歌搜索你的错误信息的最后一行时发现了它).

首先,我也得到了与您相同的错误消息,但在执行此操作后:

$ 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以后执行.


有没有一种方法可以解决此问题,而又不会破坏正常的pip安装,并且每次运行此命令后都不必每次都rm〜/ .pydistutils.cfg?
推荐阅读
TXCWB_523
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有