Skip to content

Unable to pip3 install pythonnet #1647

@amrit-poudel

Description

@amrit-poudel

Environment

  • Pythonnet version: 2.5.2
  • Python version: 3.9
  • Operating System: macosx 11.6
  • .NET Runtime:

Details

  • pip3 install pythonnet==2.5.2 crashes with error. I see the 2.5.2 does support python 3.9, was wondering why it crashes on pip3 install.

    TODO

  • What commands did you run to trigger this issue? If you can provide a
    Minimal, Complete, and Verifiable example
    this will help us understand the issue.

    print('TODO')
  • Collecting pythonnet==2.5.2
    Downloading pythonnet-2.5.2.tar.gz (1.9 MB)
    |████████████████████████████████| 1.9 MB 851 kB/s
    Preparing metadata (setup.py) ... done
    Collecting pycparser
    Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
    |████████████████████████████████| 118 kB 148 kB/s
    Building wheels for collected packages: pythonnet
    Building wheel for pythonnet (setup.py) ... error
    ERROR: Command errored out with exit status 1:
    command: /Users/apoudel/Desktop/hpc_lib/homebrew/opt/python@3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py'"'"'; file='"'"'/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-wheel-2wbatvmt
    cwd: /private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/
    Complete output (43 lines):
    running bdist_wheel
    running build
    running build_ext
    /bin/sh: mono: command not found
    Traceback (most recent call last):
    File "", line 1, in
    File "/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py", line 630, in
    setup(
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/lib/python3.9/site-packages/setuptools/init.py", line 159, in setup
    return distutils.core.setup(**attrs)
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    File "/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py", line 612, in run
    return bdist_wheel.bdist_wheel.run(self)
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
    self.run_command('build')
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
    File "/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py", line 249, in build_extension
    self._install_packages()
    File "/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py", line 438, in _install_packages
    subprocess.check_call(cmd, shell=use_shell)
    File "/Users/apoudel/Desktop/hpc_lib/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'mono tools/nuget/nuget.exe update -self' returned non-zero exit status 127.

ERROR: Failed building wheel for pythonnet
Running setup.py clean for pythonnet
Failed to build pythonnet
Installing collected packages: pycparser, pythonnet
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at Homebrew/homebrew-core#76621
Running setup.py install for pythonnet ... error
ERROR: Command errored out with exit status 1:
command: /Users/apoudel/Desktop/hpc_lib/homebrew/opt/python@3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py'"'"'; file='"'"'/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-record-rytd6lqg/install-record.txt --single-version-externally-managed --compile --install-headers /Users/apoudel/Desktop/hpc_lib/homebrew/include/python3.9/pythonnet
cwd: /private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

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

ERROR: Command errored out with exit status 1: /Users/apoudel/Desktop/hpc_lib/homebrew/opt/python@3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py'"'"'; file='"'"'/private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-install-sj3whon9/pythonnet_99c95ae1c8dc44df9dc8586a2f7ee189/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/95/c_bn57x5613fwcs5n60rckzw0000gp/T/pip-record-rytd6lqg/install-record.txt --single-version-externally-managed --compile --install-headers /Users/apoudel/Desktop/hpc_lib/homebrew/include/python3.9/pythonnet Check the logs for full command output.

    print('TODO')

I would really appreciate if someone could help me resolve this error. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions