[Python.NET] Integration pythonnet package on linux

Denis Akhiyarov denis.akhiyarov at gmail.com
Sat Jan 19 10:54:18 EST 2019


Your issue is very obvious if you read the error message:

` ModuleNotFoundError: No module named 'pycparser'`

I cannot find the instructions that I wrote in the wiki - someone might
have removed them!

Basically you need pycparser, clang, glibc:

https://github.com/pythonnet/pythonnet/issues/241#issuecomment-313178442



On Sat, Jan 19, 2019 at 9:47 AM <Sebastian_Muhr at zollner.de> wrote:

> Hello,
>
> i have a problem by integration the pythonnet module in python 3.6.5 on my
> linux PC.
> My install command on the command line is: "sudo pip python3.6 -m pip
> install pythonnet"
>
> After this command the following error message occurs:
>
> ~$ sudo python3.6 -m pip install pythonnet
>
> Collecting pythonnet
>   Using cached
> https://files.pythonhosted.org/packages/89/3b/a22cd45b591d6cf490ee8b24d52b9db1f30b4b478b64a9b231c53474731e/pythonnet-2.3.0.tar.gz
> Building wheels for collected packages: pythonnet
>   Running setup.py bdist_wheel for pythonnet ... error
>   Complete output from command /usr/bin/python3.6 -u -c "import
> setuptools,
> tokenize;__file__='/tmp/pip-build-glyvbjcf/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/tmp5ekm4p_6pip-wheel- --python-tag cp36:
>   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.9.2.
>   Update successful.
>   MSBuild auto-detection: using msbuild version '15.0' from
> '/usr/lib/mono/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.3.6.0' to folder
> '/tmp/pip-build-glyvbjcf/pythonnet/packages'
>   Adding package 'UnmanagedExports.1.2.7' to folder
> '/tmp/pip-build-glyvbjcf/pythonnet/packages'
>   Adding package 'NUnit.ConsoleRunner.3.6.0' to folder
> '/tmp/pip-build-glyvbjcf/pythonnet/packages'
>   Added package 'NUnit.ConsoleRunner.3.6.0' to folder
> '/tmp/pip-build-glyvbjcf/pythonnet/packages'
>   Added package 'UnmanagedExports.1.2.7' to folder
> '/tmp/pip-build-glyvbjcf/pythonnet/packages'
>   Added package 'NUnit.3.6.0' to folder
> '/tmp/pip-build-glyvbjcf/pythonnet/packages'
>
>   NuGet Config files used:
>       /root/.config/NuGet/NuGet.Config
>
>   Feeds used:
>       /root/.nuget/packages/
>       https://api.nuget.org/v3/index.json
>
>   Installed:
>       3 package(s) to packages.config projects
>   Traceback (most recent call last):
>     File "tools/geninterop/geninterop.py", line 24, in <module>
>       from pycparser import c_ast, c_parser
>   ModuleNotFoundError: No module named 'pycparser'
>   Traceback (most recent call last):
>     File "<string>", line 1, in <module>
>     File "/tmp/pip-build-glyvbjcf/pythonnet/setup.py", line 405, in
> <module>
>       zip_safe=False,
>     File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line
> 129, in setup
>       return distutils.core.setup(**attrs)
>     File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
>       dist.run_commands()
>     File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
>       self.run_command(cmd)
>     File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
>       cmd_obj.run()
>     File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 204,
> in run
>       self.run_command('build')
>     File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
>       self.distribution.run_command(command)
>     File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
>       cmd_obj.run()
>     File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
>       self.run_command(cmd_name)
>     File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
>       self.distribution.run_command(command)
>     File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
>       cmd_obj.run()
>     File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in
> run
>       self.build_extensions()
>     File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in
> build_extensions
>       self._build_extensions_serial()
>     File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in
> _build_extensions_serial
>       self.build_extension(ext)
>     File "/tmp/pip-build-glyvbjcf/pythonnet/setup.py", line 191, in
> build_extension
>       subprocess.check_call([sys.executable, geninterop, interop_file])
>     File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
>       raise CalledProcessError(retcode, cmd)
>   subprocess.CalledProcessError: Command '['/usr/bin/python3.6',
> 'tools/geninterop/geninterop.py', 'src/runtime/interop36m.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 /usr/bin/python3.6 -u -c "import
> setuptools,
> tokenize;__file__='/tmp/pip-build-glyvbjcf/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-9gp30c6w-record/install-record.txt
> --single-version-externally-managed --compile:
>     running install
>     running build
>     running build_ext
>     Checking for updates from https://www.nuget.org/api/v2/.
>     Currently running NuGet.exe 4.9.2.
>     NuGet.exe is up to date.
>     MSBuild auto-detection: using msbuild version '15.0' from
> '/usr/lib/mono/msbuild/15.0/bin'.
>     All packages listed in packages.config are already installed.
>     Traceback (most recent call last):
>       File "tools/geninterop/geninterop.py", line 24, in <module>
>         from pycparser import c_ast, c_parser
>     ModuleNotFoundError: No module named 'pycparser'
>     Traceback (most recent call last):
>       File "<string>", line 1, in <module>
>       File "/tmp/pip-build-glyvbjcf/pythonnet/setup.py", line 405, in
> <module>
>         zip_safe=False,
>       File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line
> 129, in setup
>         return distutils.core.setup(**attrs)
>       File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
>         dist.run_commands()
>       File "/usr/lib/python3.6/distutils/dist.py", line 955, in
> run_commands
>         self.run_command(cmd)
>       File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
>         cmd_obj.run()
>       File "/usr/lib/python3/dist-packages/setuptools/command/install.py",
> line 61, in run
>         return orig.install.run(self)
>       File "/usr/lib/python3.6/distutils/command/install.py", line 589, in
> run
>         self.run_command('build')
>       File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
>         self.distribution.run_command(command)
>       File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
>         cmd_obj.run()
>       File "/usr/lib/python3.6/distutils/command/build.py", line 135, in
> run
>         self.run_command(cmd_name)
>       File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
>         self.distribution.run_command(command)
>       File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
>         cmd_obj.run()
>       File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339,
> in run
>         self.build_extensions()
>       File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448,
> in build_extensions
>         self._build_extensions_serial()
>       File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473,
> in _build_extensions_serial
>         self.build_extension(ext)
>       File "/tmp/pip-build-glyvbjcf/pythonnet/setup.py", line 191, in
> build_extension
>         subprocess.check_call([sys.executable, geninterop, interop_file])
>       File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
>         raise CalledProcessError(retcode, cmd)
>     subprocess.CalledProcessError: Command '['/usr/bin/python3.6',
> 'tools/geninterop/geninterop.py', 'src/runtime/interop36m.cs']' returned
> non-zero exit status 1.
>
>     ----------------------------------------
> Command "/usr/bin/python3.6 -u -c "import setuptools,
> tokenize;__file__='/tmp/pip-build-glyvbjcf/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-9gp30c6w-record/install-record.txt
> --single-version-externally-managed --compile" failed with error code 1 in
> /tmp/pip-build-glyvbjcf/pythonnet/
>
>
> You may can help me solving this problem?
> Thanks in advance.
>
> Mit freundlichen Grüßen
> Best regards
>
> *Sebastian Muhr*
> Research Development Software [RDS]
>
> *Zollner Elektronik AG*
> Zandt Headquarters
> Manfred-Zollner-Str. 1
> 93499 Zandt/GERMANY
> Phone:   +49 9944 201-9546
> E-mail:    sebastian_muhr at zollner.de
> Internet:   www.zollner.de
>
>
>
>
>
> Zollner Elektronik AG
> Manfred-Zollner-Str. 1 / D-93499 Zandt / phone: +49 9944 201-0 / fax: +49
> 9944 201-1314 / info at zollner.de / www.zollner.de
> Sitz: Zandt / Manfred-Zollner-Str. 1 / Registergericht Regensburg HRB 8354
>
> Vorstand: Johann Weber (Vorsitzender) / Ludwig Zollner (stellvertretender
> Vorsitzender) / Manfred Zollner jun. / Christian Zollner / Thomas Schreiner
> Aufsichtsrat: Manfred Zollner sen. (Vorsitzender)
>
>
> Der Inhalt dieser E-Mail, insbesondere alle Kunden- und Lieferantendaten
> sowie etwaige beigefuegte Dateien, sind grundsaetzlich vertraulich. Diese
> Informationen duerfen nicht an Dritte weitergegeben werden sofern dies
> nicht zwingend zur Ausfuehrung des Auftrages notwendig ist. Vertragliche
> Vereinbarungen zwischen beiden Parteien bleiben hiervon unberuehrt.
>
> The contents of this email, particularly all customer and supplier data,
> as well as any attached files, are strictly confidential. This information
> may not be forwarded to third parties, unless this is mandatory for
> executing the order. Contractual agreements between both parties will
> remain unaffected by this.
>
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> https://mail.python.org/mailman/listinfo/pythondotnet
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20190119/b1fb579d/attachment-0001.html>


More information about the PythonDotNet mailing list