[Python.NET] Pip Install Pythonnet error

Phat Loc ploc at fortress.com
Wed Oct 10 09:28:38 EDT 2018


Hi All,

I am trying do a pip install  of pythonnet. I get the following build errors. Any suggestions on how to fix it?


(base) C:\Users\ploc>pip install pythonnet
Collecting pythonnet
  Using cached https://files.pythonhosted.org/packages/89/3b/a22cd45b591d6cf490e
e8b24d52b9db1f30b4b478b64a9b231c53474731e/pythonnet-2.3.0.tar.gz
Building wheels for collected packages: pythonnet
  Running setup.py bdist_wheel for pythonnet ... error
  Complete output from command c:\users\ploc\appdata\local\continuum\anaconda3\p
ython.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ploc\\AppData\
\Local\\Temp\\pip-install-r86ym617\\pythonnet\\setup.py';f=getattr(tokenize, 'op
en', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(
code, __file__, 'exec'))" bdist_wheel -d C:\Users\ploc\AppData\Local\Temp\pip-wh
eel-9cgf0yo2 --python-tag cp37:
  running bdist_wheel
  running build
  running build_ext
  Checking for updates from https://www.nuget.org/api/v2/.
  Currently running NuGet.exe 3.5.0.
  Updating NuGet.exe to 4.7.1.
  Update successful.
  MSBuild auto-detection: using msbuild version '15.6.82.30579' from 'C:\Program
Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
  Restoring NuGet package NUnit.3.6.0.
  Restoring NuGet package UnmanagedExports.1.2.7.
  Restoring NuGet package NUnit.ConsoleRunner.3.6.0.
  Adding package 'NUnit.ConsoleRunner.3.6.0' to folder 'C:\Users\ploc\AppData\Lo
cal\Temp\pip-install-r86ym617\pythonnet\packages'
  Adding package 'NUnit.3.6.0' to folder 'C:\Users\ploc\AppData\Local\Temp\pip-i
nstall-r86ym617\pythonnet\packages'
  Adding package 'UnmanagedExports.1.2.7' to folder 'C:\Users\ploc\AppData\Local
\Temp\pip-install-r86ym617\pythonnet\packages'
  Added package 'UnmanagedExports.1.2.7' to folder 'C:\Users\ploc\AppData\Local\
Temp\pip-install-r86ym617\pythonnet\packages'
  Added package 'NUnit.ConsoleRunner.3.6.0' to folder 'C:\Users\ploc\AppData\Loc
al\Temp\pip-install-r86ym617\pythonnet\packages'
  Added package 'NUnit.3.6.0' to folder 'C:\Users\ploc\AppData\Local\Temp\pip-in
stall-r86ym617\pythonnet\packages'

  NuGet Config files used:
      C:\Users\ploc\AppData\Roaming\NuGet\NuGet.Config
      C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config

  Feeds used:
      C:\Users\ploc\.nuget\packages\
      https://www.nuget.org/api/v2/
      http://nuget.grapecity.com/nuget
      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

  Installed:
      3 package(s) to packages.config projects
  Traceback (most recent call last):
    File "tools\geninterop\geninterop.py", line 292, in <module>
      sys.exit(main())
    File "tools\geninterop\geninterop.py", line 272, in main
      python_h = preprocess_python_headers()
    File "tools\geninterop\geninterop.py", line 192, in preprocess_python_header
s
      for line in _check_output(cmd).splitlines():
    File "tools\geninterop\geninterop.py", line 41, in _check_output
      output = subprocess.check_output(*args, **kwargs)
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py", li
ne 376, in check_output
      **kwargs).stdout
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py", li
ne 453, in run
      with Popen(*popenargs, **kwargs) as process:
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py", li
ne 756, in __init__
      restore_signals, start_new_session)
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py", li
ne 1155, in _execute_child
      startupinfo)
  FileNotFoundError: [WinError 2] The system cannot find the file specified
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\ploc\AppData\Local\Temp\pip-install-r86ym617\pythonnet\setup.
py", line 405, in <module>
      zip_safe=False,
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\site-packages\setu
ptools\__init__.py", line 140, in setup
      return distutils.core.setup(**attrs)
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\core.py"
, line 148, in setup
      dist.run_commands()
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\dist.py"
, line 966, in run_commands
      self.run_command(cmd)
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\dist.py"
, line 985, in run_command
      cmd_obj.run()
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\site-packages\whee
l\bdist_wheel.py", line 188, in run
      self.run_command('build')
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\cmd.py",
line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\dist.py"
, line 985, in run_command
      cmd_obj.run()
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\command\
build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\cmd.py",
line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\dist.py"
, line 985, in run_command
      cmd_obj.run()
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\command\
build_ext.py", line 339, in run
      self.build_extensions()
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\command\
build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\command\
build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "C:\Users\ploc\AppData\Local\Temp\pip-install-r86ym617\pythonnet\setup.
py", line 191, in build_extension
      subprocess.check_call([sys.executable, geninterop, interop_file])
    File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py", li
ne 328, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['c:\\users\\ploc\\appdata\\local\\con
tinuum\\anaconda3\\python.exe', 'tools\\geninterop\\geninterop.py', 'src\\runtim
e\\interop37.cs']' returned non-zero exit status 1.

  ----------------------------------------
  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 c:\users\ploc\appdata\local\continuum\anaconda3
\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ploc\\AppDat
a\\Local\\Temp\\pip-install-r86ym617\\pythonnet\\setup.py';f=getattr(tokenize, '
open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compil
e(code, __file__, 'exec'))" install --record C:\Users\ploc\AppData\Local\Temp\pi
p-record-qmhk9uw7\install-record.txt --single-version-externally-managed --compi
le:
    running install
    running build
    running build_ext
    Checking for updates from https://www.nuget.org/api/v2/.
    Currently running NuGet.exe 4.7.1.
    NuGet.exe is up to date.
    MSBuild auto-detection: using msbuild version '15.6.82.30579' from 'C:\Progr
am Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
    All packages listed in packages.config are already installed.
    Traceback (most recent call last):
      File "tools\geninterop\geninterop.py", line 292, in <module>
        sys.exit(main())
      File "tools\geninterop\geninterop.py", line 272, in main
        python_h = preprocess_python_headers()
      File "tools\geninterop\geninterop.py", line 192, in preprocess_python_head
ers
        for line in _check_output(cmd).splitlines():
      File "tools\geninterop\geninterop.py", line 41, in _check_output
        output = subprocess.check_output(*args, **kwargs)
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py",
line 376, in check_output
        **kwargs).stdout
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py",
line 453, in run
        with Popen(*popenargs, **kwargs) as process:
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py",
line 756, in __init__
        restore_signals, start_new_session)
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py",
line 1155, in _execute_child
        startupinfo)
    FileNotFoundError: [WinError 2] The system cannot find the file specified
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\ploc\AppData\Local\Temp\pip-install-r86ym617\pythonnet\setu
p.py", line 405, in <module>
        zip_safe=False,
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\site-packages\se
tuptools\__init__.py", line 140, in setup
        return distutils.core.setup(**attrs)
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\core.p
y", line 148, in setup
        dist.run_commands()
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\dist.p
y", line 966, in run_commands
        self.run_command(cmd)
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\dist.p
y", line 985, in run_command
        cmd_obj.run()
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\site-packages\se
tuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\comman
d\install.py", line 545, in run
        self.run_command('build')
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\cmd.py
", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\dist.p
y", line 985, in run_command
        cmd_obj.run()
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\comman
d\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\cmd.py
", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\dist.p
y", line 985, in run_command
        cmd_obj.run()
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\comman
d\build_ext.py", line 339, in run
        self.build_extensions()
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\comman
d\build_ext.py", line 448, in build_extensions
        self._build_extensions_serial()
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\distutils\comman
d\build_ext.py", line 473, in _build_extensions_serial
        self.build_extension(ext)
      File "C:\Users\ploc\AppData\Local\Temp\pip-install-r86ym617\pythonnet\setu
p.py", line 191, in build_extension
        subprocess.check_call([sys.executable, geninterop, interop_file])
      File "c:\users\ploc\appdata\local\continuum\anaconda3\lib\subprocess.py",
line 328, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['c:\\users\\ploc\\appdata\\local\\c
ontinuum\\anaconda3\\python.exe', 'tools\\geninterop\\geninterop.py', 'src\\runt
ime\\interop37.cs']' returned non-zero exit status 1.

    ----------------------------------------
Command "c:\users\ploc\appdata\local\continuum\anaconda3\python.exe -u -c "impor
t setuptools, tokenize;__file__='C:\\Users\\ploc\\AppData\\Local\\Temp\\pip-inst
all-r86ym617\\pythonnet\\setup.py';f=getattr(tokenize, 'open', open)(__file__);c
ode=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'
))" install --record C:\Users\ploc\AppData\Local\Temp\pip-record-qmhk9uw7\instal
l-record.txt --single-version-externally-managed --compile" failed with error co
de 1 in C:\Users\ploc\AppData\Local\Temp\pip-install-r86ym617\pythonnet\

Thanks,

Phat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20181010/c8ecb5dc/attachment-0001.html>


More information about the PythonDotNet mailing list