Pip Pythonnet选项-无法识别单一版本-外部管理

问题描述 投票:0回答:1

[尝试在Windows WSL的Ubuntu 18.04 Bionic上安装pythonnet 2.4.0,出现以下错误。

安装的单声道版本是5.20.1.34和Python 3.6

----------------------------------------
  Failed building wheel for pythonnet
  Running setup.py clean for pythonnet
Failed to build pythonnet
Installing collected packages: pythonnet
  Running setup.py install for pythonnet ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-srixmeza/pythonnet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-4wn8c3_a-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    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

    ----------------------------------------
python python.net
1个回答
0
投票

问题是我使用的是指python2 pip的“ pip”,应该使用pip3。

这已为我修复:

$ sudo apt install python3-pip
$ pip3 install pythonnet==2.4.0
© www.soinside.com 2019 - 2024. All rights reserved.