VarianAPIs / PyESAPI

Python interface to Eclipse Scripting API
MIT License
69 stars 32 forks source link

Python3 compatibility #15

Closed renatobellotti closed 3 years ago

renatobellotti commented 3 years ago

I've tried to run the installation command

pip3 install https://api.github.com/repos/VarianAPIs/PyESAPI/tarball

in a fresh virtual environment (Python 3.9.1 on Fedora 33), which gives me a bunch of errors. Is this package not compatible with Python3?

The error message:

ERROR: Command errored out with exit status 1:
   command: [EDITED_PATH]/.env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3wr6z42w/pythonnet/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3wr6z42w/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/pip-wheel-c6ua9if7
       cwd: /tmp/pip-install-3wr6z42w/pythonnet/
  Complete output (91 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.8.0.
  Update successful.
  MSBuild auto-detection: using msbuild version '14.0' from '/usr/lib/mono/xbuild/14.0/bin'.

  >>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<

  MSBUILD: error MSBUILD0004: Too many project files specified

  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.12.0.
  Restoring NuGet package NUnit.ConsoleRunner.3.11.1.
  Restoring NuGet package System.ValueTuple.4.5.0.
  Restoring NuGet package UnmanagedExports.1.2.7.
  Adding package 'System.ValueTuple.4.5.0' to folder '/tmp/pip-install-3wr6z42w/pythonnet/packages'
  Adding package 'NUnit.ConsoleRunner.3.11.1' to folder '/tmp/pip-install-3wr6z42w/pythonnet/packages'
  Adding package 'NUnit.3.12.0' to folder '/tmp/pip-install-3wr6z42w/pythonnet/packages'
  Adding package 'UnmanagedExports.1.2.7' to folder '/tmp/pip-install-3wr6z42w/pythonnet/packages'
  Added package 'UnmanagedExports.1.2.7' to folder '/tmp/pip-install-3wr6z42w/pythonnet/packages'
  Added package 'NUnit.ConsoleRunner.3.11.1' to folder '/tmp/pip-install-3wr6z42w/pythonnet/packages'
  Added package 'System.ValueTuple.4.5.0' to folder '/tmp/pip-install-3wr6z42w/pythonnet/packages'
  Added package 'NUnit.3.12.0' to folder '/tmp/pip-install-3wr6z42w/pythonnet/packages'

  NuGet Config files used:
      /home/renato/.config/NuGet/NuGet.Config

  Feeds used:
      /home/renato/.nuget/packages/
      https://api.nuget.org/v3/index.json

  Installed:
      4 package(s) to packages.config projects
  Traceback (most recent call last):
    File "/tmp/pip-install-3wr6z42w/pythonnet/tools/geninterop/geninterop.py", line 307, in <module>
      sys.exit(main())
    File "/tmp/pip-install-3wr6z42w/pythonnet/tools/geninterop/geninterop.py", line 287, in main
      python_h = preprocess_python_headers()
    File "/tmp/pip-install-3wr6z42w/pythonnet/tools/geninterop/geninterop.py", line 207, in preprocess_python_headers
      for line in _check_output(cmd).splitlines():
    File "/tmp/pip-install-3wr6z42w/pythonnet/tools/geninterop/geninterop.py", line 41, in _check_output
      output = subprocess.check_output(*args, **kwargs)
    File "/usr/lib64/python3.9/subprocess.py", line 420, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/usr/lib64/python3.9/subprocess.py", line 501, in run
      with Popen(*popenargs, **kwargs) as process:
    File "/usr/lib64/python3.9/subprocess.py", line 947, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/lib64/python3.9/subprocess.py", line 1819, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'clang'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-3wr6z42w/pythonnet/setup.py", line 630, in <module>
      setup(
    File "[EDITED_PATH]/tmp/2021-01-04/.env/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib64/python3.9/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib64/python3.9/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/lib64/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-3wr6z42w/pythonnet/setup.py", line 612, in run
      return bdist_wheel.bdist_wheel.run(self)
    File "[EDITED_PATH]/tmp/2021-01-04/.env/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "/usr/lib64/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib64/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/lib64/python3.9/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/lib64/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib64/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/lib64/python3.9/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/usr/lib64/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
      self._build_extensions_serial()
    File "/usr/lib64/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
      self.build_extension(ext)
    File "/tmp/pip-install-3wr6z42w/pythonnet/setup.py", line 302, in build_extension
      subprocess.check_call([sys.executable, geninterop, interop_file])
    File "/usr/lib64/python3.9/subprocess.py", line 373, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['[EDITED_PATH]/tmp/2021-01-04/.env/bin/python', 'tools/geninterop/geninterop.py', 'src/runtime/interop39.cs']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for pythonnet
fizxmike commented 3 years ago

Python 3 has been tested to work. Unfortunately PyESAPI cannot run on Lynux. You must use an existing Eclipse (research) system.

sama2689 commented 2 years ago

If anyone on a windows machine gets this error you might want to try installing pythonnet separately via conda conda install -c conda-forge pythonnet prior to installing pyesapi via pip. I had the same issue installing on Python 3.8 on Windows with an Eclipse machine.