tried installing pythonnet using pip install.
the installatiom fails.
-pip install pythonnet
pip install pythonnet
Collecting pythonnet
Using cached https://files.pythonhosted.org/packages/4a/0a/5964a5a1fdf207fab8e718edd1f8d3578e0681577fe9abe0d9006f9718c2/pythonnet-2.4.0.tar.gz
Building wheels for collected packages: pythonnet
Building wheel for pythonnet (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\alm\AppData\Local\Temp\pip-install-24yx5gsj\pythonnet\setup.py'"'"'; __file__='"'"'C:\Users\alm\AppData\Local\Temp\pip-install-24yx5gsj\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 'C:\Users\alm\AppData\LocalTemp\pip-wheel-a7ayn606' --python-tag cp38
cwd: C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\
Complete output (85 lines):
running bdist_wheel
running build
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 4.1.0.
Updating NuGet.exe to 5.3.1.
Update successful.
Cannot find the specified version of msbuild: '14'
MSBuild auto-detection: using msbuild version '16.4.0.50203' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\bin'.
Restoring NuGet package UnmanagedExports.1.2.7.
Restoring NuGet package NUnit.3.7.1.
Restoring NuGet package NUnit.ConsoleRunner.3.7.0.
Adding package 'UnmanagedExports.1.2.7' to folder 'C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\packages'
Adding package 'NUnit.3.7.1' to folder 'C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\packages'
Adding package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\packages'
Added package 'UnmanagedExports.1.2.7' to folder 'C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\packages'
Added package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\packages'
Added package 'NUnit.3.7.1' to folder 'C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\packages'
NuGet Config files used:
C:\Users\alm\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
C:\Users\alm.nuget\packages\
https://api.nuget.org/v3/index.json
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 293, in
sys.exit(main())
File "tools\geninterop\geninterop.py", line 273, in main
python_h = preprocess_python_headers()
File "tools\geninterop\geninterop.py", line 193, in preprocess_python_headers
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:\python\lib\subprocess.py", line 411, in check_output
return run(popenargs, stdout=PIPE, timeout=timeout, check=True,
File "c:\python\lib\subprocess.py", line 489, in run
with Popen(popenargs, *kwargs) as process:
File "c:\python\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "c:\python\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Traceback (most recent call last):
File "
File "C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\setup.py", line 623, in
setup(
File "c:\python\lib\site-packages\setuptools__init__.py", line 145, in setup
return distutils.core.setup(attrs)
File "c:\python\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\python\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\setup.py", line 610, in run
return bdist_wheel.bdist_wheel.run(self)
File "c:\python\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "c:\python\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\python\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\python\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\python\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "c:\python\lib\distutils\command\build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "c:\python\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\pythonnet\setup.py", line 298, in build_extension
subprocess.check_call([sys.executable, geninterop, interop_file])
File "c:\python\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['c:\python\python.exe', 'tools\geninterop\geninterop.py', 'src\runtime\interop38.cs']' returned non-zero exit status 1.
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: 'c:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\alm\AppData\Local\Temp\pip-install-24yx5gsj\pythonnet\setup.py'"'"'; __file__='"'"'C:\Users\alm\AppData\Local\Temp\pip-install-24yx5gsj\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 'C:\Users\alm\AppData\LocalTemp\pip-record-ckcw2uuj\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\alm\AppData\LocalTemp\pip-install-24yx5gsj\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: 'c:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\alm\AppData\Local\Temp\pip-install-24yx5gsj\pythonnet\setup.py'"'"'; __file__='"'"'C:\Users\alm\AppData\Local\Temp\pip-install-24yx5gsj\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 'C:\Users\alm\AppData\LocalTemp\pip-record-ckcw2uuj\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Happening to me as well
Pythonnet version: 2.4.0
Python version: 3.8.1
Operating System: Windows 10 ver 1909
I'm seeing this as well.
Pythonnet version: 2.4.0
Python version: 3.8.1
OS Name Microsoft Windows 10 Home
Version 10.0.18363 Build 18363
I'm going to try dropping back to 3.7 and see if that behaves better.
Downgraded to Python 3.7.6 and didn't have any install issues.
Version 2.4.0 does not support Python 3.8. It's also not documented that it does...
If you want to use Python.NET with 3.8 you will have to use the current master or wait for 2.4.1 or 2.5.0.
Most helpful comment
Version 2.4.0 does not support Python 3.8. It's also not documented that it does...
If you want to use Python.NET with 3.8 you will have to use the current master or wait for 2.4.1 or 2.5.0.