0

I'm trying to install pythonnet via pip install pythonnet but accord error shown here:

Collecting pythonnet
  Using cached pythonnet-2.4.0.tar.gz (1.8 MB)
Building wheels for collected packages: pythonnet
  Building wheel for pythonnet (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/paziresh/virtualenv/paziresh365/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jcvixpk5/pythonnet/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jcvixpk5/pythonnet/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 /tmp/pip-wheel-ig8_5h8m
       cwd: /tmp/pip-install-jcvixpk5/pythonnet/
  Complete output (43 lines):
  running bdist_wheel
  running build
  running build_ext
  /bin/sh: mono: command not found
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-jcvixpk5/pythonnet/setup.py", line 658, in <module>
      zip_safe=False,
    File "/home/paziresh/virtualenv/paziresh365/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 161, in setup
      return distutils.core.setup(**attrs)
    File "/opt/alt/python36/lib64/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-jcvixpk5/pythonnet/setup.py", line 610, in run
      return bdist_wheel.bdist_wheel.run(self)
    File "/home/paziresh/virtualenv/paziresh365/3.6/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "/opt/alt/python36/lib64/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/opt/alt/python36/lib64/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/opt/alt/python36/lib64/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/opt/alt/python36/lib64/python3.6/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "/opt/alt/python36/lib64/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "/opt/alt/python36/lib64/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "/tmp/pip-install-jcvixpk5/pythonnet/setup.py", line 245, in build_extension
      self._install_packages()
    File "/tmp/pip-install-jcvixpk5/pythonnet/setup.py", line 424, in _install_packages
      subprocess.check_call(cmd, shell=use_shell)
    File "/opt/alt/python36/lib64/python3.6/subprocess.py", line 311, 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: pythonnet
    Running setup.py install for pythonnet ... error
    ERROR: Command errored out with exit status 1:
     command: /home/paziresh/virtualenv/paziresh365/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jcvixpk5/pythonnet/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jcvixpk5/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-record-uuxxm05w/install-record.txt --single-version-externally-managed --compile --install-headers /home/paziresh/virtualenv/paziresh365/3.6/include/site/python3.6/pythonnet
         cwd: /tmp/pip-install-jcvixpk5/pythonnet/
    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: /home/paziresh/virtualenv/paziresh365/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jcvixpk5/pythonnet/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jcvixpk5/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-record-uuxxm05w/install-record.txt --single-version-externally-managed --compile --install-headers /home/paziresh/virtualenv/paziresh365/3.6/include/site/python3.6/pythonnet Check the logs for full command output.

made some searches and found required libs are wheel, setuptools and scons.so all of them are installed and updated. but nothing changed! any new idea about that?

  • I'm using python 3.6.8 and Linux
Saeed Ramezani
  • 462
  • 6
  • 20

0 Answers0