pythonnet icon indicating copy to clipboard operation
pythonnet copied to clipboard

Ubuntu 16.04 pip3 install failure

Open danlittlejohn opened this issue 9 years ago • 5 comments

Environment

  • Pythonnet version: 2.3.0
  • Python version: 3.5.2
  • Operating System: Ubuntu 16.04

Details

Trying to install and getting this failure, which I cannot seem to figure out.

user@bix# pip3 install pythonnet Collecting pythonnet Using cached pythonnet-2.3.0.tar.gz Building wheels for collected packages: pythonnet Running setup.py bdist_wheel for pythonnet ... error Complete output from command /var/www/html/dev_mm_manager/virtualenv/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-m3ryjecj/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/tmp7lwboz5epip-wheel- --python-tag cp35: 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.1.0. Update successful. MSBuild auto-detection: using msbuild version '14.0' from '/usr/lib/mono/xbuild/14.0/bin'. WARNING: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects will be skipped, only packages.config files will be restored. Restoring NuGet package NUnit.3.6.0. Adding package 'NUnit.3.6.0' to folder '/tmp/pip-build-m3ryjecj/pythonnet/packages' Added package 'NUnit.3.6.0' to folder '/tmp/pip-build-m3ryjecj/pythonnet/packages' Restoring NuGet package NUnit.ConsoleRunner.3.6.0. Adding package 'NUnit.ConsoleRunner.3.6.0' to folder '/tmp/pip-build-m3ryjecj/pythonnet/packages' Added package 'NUnit.ConsoleRunner.3.6.0' to folder '/tmp/pip-build-m3ryjecj/pythonnet/packages' Restoring NuGet package UnmanagedExports.1.2.7. Adding package 'UnmanagedExports.1.2.7' to folder '/tmp/pip-build-m3ryjecj/pythonnet/packages' Added package 'UnmanagedExports.1.2.7' to folder '/tmp/pip-build-m3ryjecj/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 292, in 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_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 "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 693, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.5/subprocess.py", line 947, in init restore_signals, start_new_session) File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'clang' Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-m3ryjecj/pythonnet/setup.py", line 405, in zip_safe=False, File "/usr/lib/python3.5/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/var/www/html/dev_mm_manager/virtualenv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 179, in run self.run_command('build') File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/lib/python3.5/distutils/command/build_ext.py", line 338, in run self.build_extensions() File "/usr/lib/python3.5/distutils/command/build_ext.py", line 447, in build_extensions self._build_extensions_serial() File "/usr/lib/python3.5/distutils/command/build_ext.py", line 472, in _build_extensions_serial self.build_extension(ext) File "/tmp/pip-build-m3ryjecj/pythonnet/setup.py", line 191, in build_extension subprocess.check_call([sys.executable, geninterop, interop_file]) File "/usr/lib/python3.5/subprocess.py", line 581, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/var/www/html/dev_mm_manager/virtualenv/bin/python3', 'tools/geninterop/geninterop.py', 'src/runtime/interop35m.cs']' returned non-zero exit status 1

Seems like I am missing something, but not sure what.

danlittlejohn avatar Jun 22 '17 14:06 danlittlejohn

@danlittlejohn as you can see you are missing clang:

FileNotFoundError: [Errno 2] No such file or directory: 'clang'

https://github.com/pythonnet/pythonnet/wiki/Troubleshooting-on-Windows-and-Linux#2-build-and-install-from-command-line

den-run-ai avatar Jun 22 '17 16:06 den-run-ai

Thanks. That was part of it, but even with it installed correctly I needed a newer mono-complete to get 2.3.0 working.

apt-get clang libglib2.0-dev

apt -y remove --purge --auto-remove mono-runtime
echo "deb http://download.mono-project.com/repo/ubuntu wheezy/snapshots/4.8.0 main" | sudo tee /etc/apt/sources.list.d/mono-official.list
apt-get update
apt-get -y install mono-complete

danlittlejohn avatar Jun 27 '17 00:06 danlittlejohn

@danlittlejohn yes, mono-complete 4.8+ is required.

den-run-ai avatar Jun 27 '17 00:06 den-run-ai

@denfromufa Is there anything left to do here?

filmor avatar Aug 30 '18 11:08 filmor

I've added the version requirement to the troubleshooting page, that should do it.

filmor avatar Aug 30 '18 15:08 filmor