How to fix "error: option --single-version-externally-managed not recognized"

How to fix "error: option --single-version-externally-managed not recognized"

我会预先指出,我已经看到 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\

我在谷歌上搜索了一段时间,但没有成功。

有什么想法吗?

error: [Errno 2] No such file or directory: 'installer/picard-setup.nsi.in'

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

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

error: option --single-version-externally-managed not recognized

这是 python setup.py install 的一个选项。尝试 运行 python setup.py install --help 与任何 setup.py 并查看它是否具有

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

快结束了。

问题是 setup.py 的 windows-specific 部分位于 https://github.com/metabrainz/picard/blob/d141f019c2b88ab6a3a21c04110dad0522e36616/setup.py#L225-L236,特别是

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

尝试从 installer/picard-setup.nsi.in 生成 installer/picard-setup.nsi。但是,PyPI 上的源代码压缩包甚至不包含 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/ 的安装程序。