Attempting to install pythonnet using powershell as administrator
Python install is not managed by Canopy, but Canopy Installed. Same error produced by using easy_install.exe
An error appears after update of nuget. This appears after NuGet update:
Installed:
3 package(s) to packages.config projects
Microsoft (R) Manifest Tool version 10.0.10011.16384
Copyright (c) Microsoft Corporation 2012.
All rights reserved.
Microsoft (R) Build Engine version 4.6.1038.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) Build Engine version 4.6.1038.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
The Error:
CSC : error CS1617: Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default [C:\u
AppData\Local\Enthought\Canopy\User\Lib\site-packages\pythonnet-2.3.0\src\runtime\Python.Runtime.csproj
CSC : error CS1617: Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default [C:\u
AppData\Local\Enthought\Canopy\User\Lib\site-packages\pythonnet-2.3.0\src\clrmodule\clrmodule.csproj]
_TODO_
What commands did you run to trigger this issue?
Executing command: python setup.py build_ext --inplace
The first execution is an update of Nuget (every time).
NuGet is updated from 3.5.0 to 4.1.0, and installed 'successfully'.
If there was a crash, please include the traceback here.
Traceback (most recent call last):
File "setup.py", line 405, in
zip_safe=False,
File "C:\Program Files\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Program Files\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Program Files\Anaconda3\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Program Files\Anaconda3\lib\distutils\command\build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "C:\Program Files\Anaconda3\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "setup.py", line 222, in build_extension
subprocess.check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell)
File "C:\Program Files\Anaconda3\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe" pythonnet.sln /p:C
onfiguration=ReleaseWin /p:Platform=x64 /p:DefineConstants="PYTHON36,PYTHON3,UCS2" /p:PythonBuildDir="C:\users\sdurbridg
e\AppData\Local\Enthought\Canopy\User\Lib\site-packages\pythonnet-2.3.0" /p:PythonInteropFile="interop36.cs" /verbosity:
minimal /p:PythonManifest="C:\users\sdurbridge\AppData\Local\Enthought\Canopy\User\Lib\site-packages\pythonnet-2.3.0\app
.manifest" /t:Build' returned non-zero exit status 1.
print('TODO')
If someone could spare some time to point me in the correct direction, I would appreciate it. I have noticed some stackexchange posts related to seeing the same issue when working with .NET 4.6 and C#, but no direct notes on a python interface, so I am not sure how to continue trying to use this solution.
Hi,
Thanks for spending some time looking at my problem.
I am building from source because that is was the installation guide suggests to do. As I said in the issue I have also tried easy_install.exe, and the problem persists i.e. building from source is not the problem.
As I mentioned in the issue I have already 'googled' the problem, but I still don't understand what the problem is so I don't understand if the fixes suggested are appropriate in this case i.e. all those links are attached to c# development for a particular version of the .NET framework.
For example I do not know how or where to access the configuration file referenced in the google search results, in order to fix the problem by using the examples. As I am not compiling a new c# program written to work with .NET, I cannot make a custom web.config file of which I could fix the compiler configuration.
Thank you again for trying to resolve this, your time is very much appreciated.
I have executed an install using Conda, and the package has appeared in the Conda terminal package list.
I will notify you when I manage to get some code running, to confirm if this has bypassed the issue.
I been using 2017 for a while now w no issues, granted I haven't build the repo since early April so maybe something broke w latest vs updates.
I'll try to reproduce this tomorrow on my machine. You can try editing the project files and removing the lang ver lines. I think it's in the first 20 lines of each csproj file.
Just tried building from latest master with no issues. Built using python setup.py build_ext --inplace and also python setup.py bdist_wheel with no issues.
closing for now, since the issue is not reproducible. @sdurbridgebw please send us more info to reproduce this, e.g. the version of msbuild. also you can ramp up the verbosity in setup.py and attach the log here.
Activity
den-run-ai commented on May 31, 2017
I'm not sure why you are building pythonnet from source?
Anyway here is a quick Google search on your error with multiple solutions:
https://www.google.com/search?q=Invalid+option+%276%27+for+%2Flangversion%3B+must+be+ISO-1%2C+ISO-2%2C+3%2C+4%2C+5+or+Default&oq=Invalid+option+%276%27+for+%2Flangversion%3B+must+be+ISO-1%2C+ISO-2%2C+3%2C+4%2C+5+or+Default&aqs=chrome..69i57.1253j0j4
sedurCode commented on May 31, 2017
Hi,
Thanks for spending some time looking at my problem.
I am building from source because that is was the installation guide suggests to do. As I said in the issue I have also tried easy_install.exe, and the problem persists i.e. building from source is not the problem.
As I mentioned in the issue I have already 'googled' the problem, but I still don't understand what the problem is so I don't understand if the fixes suggested are appropriate in this case i.e. all those links are attached to c# development for a particular version of the .NET framework.
For example I do not know how or where to access the configuration file referenced in the google search results, in order to fix the problem by using the examples. As I am not compiling a new c# program written to work with .NET, I cannot make a custom web.config file of which I could fix the compiler configuration.
Thank you for trying to help.
den-run-ai commented on May 31, 2017
Here are the installation options:
https://github.com/pythonnet/pythonnet/wiki/Installation
den-run-ai commented on Jun 1, 2017
I cannot reproduce this issue with VS 2015, .NET 4.0 or .NET 4.6.1. Maybe this has something to do with VS 2017 or msbuild version.
sedurCode commented on Jun 1, 2017
Thank you again for trying to resolve this, your time is very much appreciated.
I have executed an install using Conda, and the package has appeared in the Conda terminal package list.
I will notify you when I manage to get some code running, to confirm if this has bypassed the issue.
vmuriart commented on Jun 1, 2017
I been using 2017 for a while now w no issues, granted I haven't build the repo since early April so maybe something broke w latest vs updates.
I'll try to reproduce this tomorrow on my machine. You can try editing the project files and removing the lang ver lines. I think it's in the first 20 lines of each csproj file.
vmuriart commented on Jun 1, 2017
Just tried building from latest master with no issues. Built using python setup.py build_ext --inplace and also python setup.py bdist_wheel with no issues.
den-run-ai commented on Jun 6, 2017
closing for now, since the issue is not reproducible. @sdurbridgebw please send us more info to reproduce this, e.g. the version of msbuild. also you can ramp up the verbosity in setup.py and attach the log here.
den-run-ai commented on Oct 8, 2017
@sdurbridgebw we reproduced your issue and a fix is to be merged soon, thanks @dmitriyse
sedurCode commented on Oct 9, 2017
Hi there,
Thanks for fixing this one!
Have a great week!
sottom commented on Feb 3, 2018
I'm having this same issue and was curious if there was any progress on the fix. Thanks for working on this!