Repository navigation
Description
Hello everyone,
I try to use pythonnet with some other compiled libraries like numpy, scipy, theano, and overall keras. Pythonnet allows me too get the data I want, to treat them with keras.
The production machine config is a as follows:
- Windows 7 64
- Visual Studio 2012 Professionnal
- Python 3.4
Anyway, when I try to load my application on the production machine I get, similarly to #182:
Exception non g�r�e�: System.ArgumentException: Name must not be empty!
� Python.Runtime.ModuleObject..ctor(String name)
� Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
� Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
� Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw)
This error happened at the import keras call in my code, and it is an issue I did not have on the development machine...
Given that it seems that this error has been patched on the master branch, I'm trying to build the library from pythonnet-master. But when I run setup.py install, I get the following messages (sorry for the French language):
running install
running bdist_egg
running egg_info
writing pythonnet.egg-info\PKG-INFO
writing top-level names to pythonnet.egg-info\top_level.txt
writing dependency_links to pythonnet.egg-info\dependency_links.txt
reading manifest file 'pythonnet.egg-info\SOURCES.txt'
writing manifest file 'pythonnet.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_ext
Tous les packages répertoriés dans packages.config sont déjà installés.
Using mt.exe from Windows Kit 8.0
Microsoft (R) Manifest Tool version 6.2.9200.16384
Copyright (c) Microsoft Corporation 2012.
All rights reserved.
Microsoft (R) Build Engine, version 4.0.30319.18408
[Microsoft .NET Framework, Version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. Tous droits réservés.
Microsoft (R) Build Engine, version 4.0.30319.18408
[Microsoft .NET Framework, Version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. Tous droits réservés.
assemblymanager.cs(206,37): warning CS0168: La variable 'e' est déclarée, mais jamais utilisée [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
classderived.cs(789,90): error CS1525: Terme d'expression non valide '.' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
classderived.cs(789,91): error CS1003: Erreur de syntaxe, ':' attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
classderived.cs(789,100): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
classderived.cs(789,100): error CS1525: Terme d'expression non valide ')' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
classderived.cs(789,101): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
classderived.cs(789,101): error CS1525: Terme d'expression non valide ')' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(231,75): error CS1525: Terme d'expression non valide '.' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(231,76): error CS1003: Erreur de syntaxe, ':' attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(231,85): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(231,85): error CS1525: Terme d'expression non valide ')' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(231,86): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(231,86): error CS1525: Terme d'expression non valide ')' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(231,87): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(231,87): error CS1525: Terme d'expression non valide ')' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(231,88): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(965,57): error CS1525: Terme d'expression non valide '.' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(965,58): error CS1003: Erreur de syntaxe, ':' attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(965,67): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(965,67): error CS1525: Terme d'expression non valide ')' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(965,68): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
converter.cs(965,68): error CS1525: Terme d'expression non valide ')' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
pyobject.cs(975,67): error CS1525: Terme d'expression non valide '.' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
pyobject.cs(975,68): error CS1003: Erreur de syntaxe, ':' attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
pyobject.cs(975,77): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
pyobject.cs(975,77): error CS1525: Terme d'expression non valide ')' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
pythonengine.cs(490,69): error CS1525: Terme d'expression non valide '.' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
pythonengine.cs(490,70): error CS1003: Erreur de syntaxe, ':' attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
pythonengine.cs(490,79): error CS1002: ; attendu [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
pythonengine.cs(490,79): error CS1525: Terme d'expression non valide ')' [C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\runtime\Python.Runtime.csproj]
clrmodule -> C:\Users\user\Downloads\pythonnet-master\pythonnet-master\src\clrmodule\bin\x64\ReleaseWin\clrmodule.dll
Traceback (most recent call last):
File "C:\Users\user\Downloads\pythonnet-master\pythonnet-master\setup.py", line 358, in <module>
setup_requires=setup_requires
File "C:\Python34\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 109,in do_egg_install
self.run_command('bdist_egg')
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\setuptools\command\bdist_egg.py", line 160, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Python34\lib\site-packages\setuptools\command\bdist_egg.py", line 146, in call_command
self.run_command(cmdname)
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\distutils\command\install_lib.py", line 88, in run
self.build()
File "C:\Python34\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Python34\lib\distutils\command\build_ext.py", line 448, in build_extensions
self.build_extension(ext)
File "C:\Users\user\Downloads\pythonnet-master\pythonnet-master\setup.py", line 191, in build_extension
check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell)
File "C:\Python34\lib\subprocess.py", line 561, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe" pythonnet.sln /p:Configuration=ReleaseWin /p:Platform=x64/p:DefineConstants="PYTHON34;UCS2" /p:PythonBuildDir="C:\Users\user\Downloads\pythonnet-master\pythonnet-master\build\lib.win-amd64-3.4" /p:PythonInteropFile="interop34.cs" /verbosity:minimal /p:PythonManifest="C:\Users\user\Downloads\pythonnet-master\pythonnet-master\build\lib.win-amd64-3.4\app.manifest" /t:Build' returned non-zero exit status 1
Those errors seems to be related to syntax errors, which I can't understand.
Any idea of what could cause the build to fail?
Activity
aPere3 commentedon Aug 10, 2016
Arf I messed with #246 when trying to edit... Do I close #246 ?
den-run-ai commentedon Aug 10, 2016
@aPere3 this was merged recently here:
#219
so try to install pythonnet from master:
pip install git+https://github.com/pythonnet/pythonnet
aPere3 commentedon Aug 10, 2016
@denfromufa using this, I get the same error.
den-run-ai commentedon Aug 10, 2016
@aPere3 did you uninstall first pythonnet before installing from master? or you can pass force and update flags to pip.
den-run-ai commentedon Aug 10, 2016
if the error persists, please provide repeatable code sample with keras. to help you troubleshoot - this is likely related to relative imports.
aPere3 commentedon Aug 10, 2016
@denfromufa sorry for not being clear enough, when i said i get the same error, i meant the build failed with the same error (which doesn't surprise me, because i was trying to build pythonnet from a cloned
pythonnet-masterrepo).Effectively, the previous pythnonnet was uninstalled.
For a repeatable code that fails:
den-run-ai commentedon Aug 10, 2016
'setup.py install' is the wrong this to do. either pip install pythonnet (including from git) or python.exe setup.py bdist_wheel
den-run-ai commentedon Aug 10, 2016
i checked with the master of pythonnet and everything is working:
aPere3 commentedon Aug 10, 2016
Ok, what i tried until now is:
Which installs properly, but when I:
I get the following error:
I tried
Which didn't work and gave me:
I tried:
Which failed and lead me to:
This last method is the one I want to use. But it seems I am facing a building issue isn't it?
Sorry if I misunderstand the issue here, I am not really used to this sort of windows compiling.
den-run-ai commentedon Aug 10, 2016
have a look at appveyor builds, looks like you do not have
wheelpackageinstalled.
On Wed, Aug 10, 2016 at 12:13 PM, Alex, Péré [email protected]
wrote:
aPere3 commentedon Aug 10, 2016
@denfromufa I installed
wheelwhich changes nothing:Still gives me:
I tried to use appveyor, cloning your repo and setting the build script to:
Which lead me to:
den-run-ai commentedon Aug 10, 2016
do you have .NET 4.0+ installed ? This is requirement! I see this error "
83 CLR Version: 2.0.50727.8009 ( Net 3.5 )"
On Wed, Aug 10, 2016 at 1:05 PM, Alex, Péré [email protected]
wrote:
aPere3 commentedon Aug 10, 2016
This was on appveyor, I assume they don't.
In the case of my production machine, the .Net 4.0 is installled
den-run-ai commentedon Aug 10, 2016
if you are running this on appveyor CI machines, then disable automatic testing. as you can see from pythonnnet appveyor yaml file the tests are running manually at the end of the build.
den-run-ai commentedon Aug 10, 2016
it is in the settings of appveyor server - disable nunit i believe
aPere3 commentedon Aug 10, 2016
Ok, I'm going to try, but please first, does this line seems good to you, especially at the question mark (I do not know enough of C# to say by myself)? Because it's on this kind of question mark that the compiling fail on my side. Moreover, when I open the file with visual studio, it is also found as mistyped.
den-run-ai commentedon Aug 10, 2016
VS 2012 requires C# 6.0 features of compiler to be installed as part of
nuget package for c# compiler. I will open an issue for this. But really
VS2012 is pretty old at the pace of VS and PTVS development.
http://stackoverflow.com/a/32016203/2230844
On Wed, Aug 10, 2016 at 2:15 PM, Alex, Péré [email protected]
wrote:
den-run-ai commentedon Aug 10, 2016
btw, you can grab latest wheels here, no need to compile pythonnet:
https://ci.appveyor.com/project/TonyRoberts/pythonnet-480xs/build/job/m11tbw35v4nka809/artifacts
aPere3 commentedon Aug 11, 2016
Great, I managed to install the wheel. I managed to import everything without troubles.
Thank you very much for your help!
den-run-ai commentedon Aug 11, 2016
ok, let me know if you get any issues with building pythonnet on vs 2012
stonebig commentedon Aug 11, 2016
can anyone explain me why these artifacts are about 60ko and the cgohlke wheels are about 200K ?
den-run-ai commentedon Aug 11, 2016
@stonebig you can easily extract wheel as an archive and see content. in this case cgohlke wheels still contain legacy nPython.exe. there is no need for it anymore.
stonebig commentedon Aug 11, 2016
ok, thanks. upgrading.