如何解决“错误:选项-单一版本-外部管理不被识别”

时间:2019-06-24 13:16:33

标签: python pip windows-7

我会提前记下我看到过related thread,并且尝试安装了所有推荐的工具:setuptools,wheel,egg,但是仍然出现相同的错误。

尝试安装Picard时遇到错误:

C:\>pip install picard
Collecting picard
  Using cached https://files.pythonhosted.org/packages/e8/ec/e76d4a84d37e6bd93789bf8f7a15f9e63f94cbc8b79607a2152b3fcc313f/picard-2.1.tar.gz
Requirement already satisfied: PyQt5 in c:\program files\python37\lib\site-packages (from picard) (5.12.2)
Requirement already satisfied: mutagen in c:\program files\python37\lib\site-packages (from picard) (1.42.0)
Requirement already satisfied: PyQt5_sip<13,>=4.19.14 in c:\program files\python37\lib\site-packages (from PyQt5->picard) (4.19.17)
Building wheels for collected packages: picard
  Building wheel for picard (setup.py) ... error
  ERROR: Complete output from command 'c:\program files\python37\python.exe' -u-c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\bdb484\\AppData\\Local\\Temp\\pip-install-lc47_c7l\\picard\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\bdb484\AppData\Local\Temp\pip-wheel-7ktnx238' --python-tag cp37:
  ERROR: running bdist_wheel
  running build
  generating scripts/picard from scripts/picard.in
  error: [Errno 2] No such file or directory: 'installer/picard-setup.nsi.in'
  ----------------------------------------
  ERROR: Failed building wheel for picard
  Running setup.py clean for picard
Failed to build picard
Installing collected packages: picard
  Running setup.py install for picard ... error
    ERROR: Complete output from command 'c:\program files\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\bdb484\\AppData\\Local\\Temp\\pip-install-lc47_c7l\\picard\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\bdb484\AppData\Local\Temp\pip-record-wwek3m3r\install-record.txt' --single-version-externally-managed --compile:
    ERROR: usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: option --single-version-externally-managed not recognized
    ----------------------------------------
ERROR: Command "'c:\program files\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\bdb484\\AppData\\Local\\Temp\\pip-install-lc47_c7l\\picard\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\bdb484\AppData\Local\Temp\pip-record-wwek3m3r\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\bdb484\AppData\Local\Temp\pip-install-lc47_c7l\picard\

我已经走了一段时间,没有运气。

有什么想法吗?

2 个答案:

答案 0 :(得分:2)

问题是https://github.com/metabrainz/picard/blob/d141f019c2b88ab6a3a21c04110dad0522e36616/setup.py#L225-L236setup.py的特定于Windows的部分

  

generate_file('installer / picard-setup.nsi.in','installer / picard-setup.nsi',args)

尝试从installer/picard-setup.nsi生成installer/picard-setup.nsi.in。但是,PyPI上的源tarball甚至不包含installer目录:

↪ tar tf picard-2.1.tar.gz | grep installer
↪

我们去年(https://tickets.metabrainz.org/browse/PICARD-1373)进行了一些源分发,但是到目前为止,仅在Linux上对其进行了测试。

如果要在Windows上使用Picard,请使用https://picard.musicbrainz.org/downloads/中的安装程序。

答案 1 :(得分:1)

  

错误:[错误2]没有这样的文件或目录:'installer / picard-setup.nsi.in'

这是setup.py中的一个错误:它tries to generate a file没有首先创建目录installer。请将该错误报告给作者。尝试从存储库安装:

pip install git+https://github.com/metabrainz/picard.git#egg=picard
  

错误:选项-无法识别单一版本-外部管理

这是python setup.py install的选项。尝试将python setup.py install --help与任何setup.py一起运行,看看是否有

--single-version-externally-managed  used by system package builders to
                                     create 'flat' eggs

快结束了。