ProjectQ-Framework / ProjectQ

ProjectQ: An open source software framework for quantum computing
https://projectq.ch
Apache License 2.0
888 stars 274 forks source link

Could not install the C++-simulator #351

Closed PabloAMC closed 3 years ago

PabloAMC commented 4 years ago

I've been basically unable to install the fast version of ProjectQ. My steps were

  1. Create an environment conda create -n projectq python=3.5 conda activate projectq

  2. Followed the steps in https://projectq.readthedocs.io/en/latest/tutorials.html#detailed-instructions-and-os-specific-hints for Mac, in particular a) xcode-select --install b) sudo easy_install pip c) python -m pip install --user projectq

In the last step I invariable get

  1 warning and 1 error generated.
  Traceback (most recent call last):
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/unixccompiler.py", line 118, in _compile
      extra_postargs)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/ccompiler.py", line 909, in spawn
      spawn(cmd, dry_run=self.dry_run)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/spawn.py", line 36, in spawn
      _spawn_posix(cmd, search_path, dry_run=dry_run)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/spawn.py", line 159, in _spawn_posix
      % (cmd, exit_status))
  distutils.errors.DistutilsExecError: command '/usr/bin/clang' failed with exit status 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/private/var/folders/gy/ldg1qp5n0pbb7yh6hg5prqtm0000gn/T/pip-install-peg6s403/projectq/setup.py", line 146, in build_extensions
      build_ext.build_extensions(self)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
      _build_ext.build_ext.build_extensions(self)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/command/build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/command/build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/site-packages/setuptools/command/build_ext.py", line 199, in build_extension
      _build_ext.build_extension(self, ext)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/command/build_ext.py", line 533, in build_extension
      depends=ext.depends)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/ccompiler.py", line 574, in compile
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/unixccompiler.py", line 120, in _compile
      raise CompileError(msg)
  distutils.errors.CompileError: command '/usr/bin/clang' failed with exit status 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/gy/ldg1qp5n0pbb7yh6hg5prqtm0000gn/T/pip-install-peg6s403/projectq/setup.py", line 171, in <module>
      packages=find_packages()
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/site-packages/setuptools/__init__.py", line 140, in setup
      return distutils.core.setup(**attrs)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 202, in run
      self.run_command('build')
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/site-packages/setuptools/command/build_ext.py", line 78, in run
      _build_ext.run(self)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
      _build_ext.build_ext.run(self)
    File "/Users/pabloantoniomorenocasares/opt/anaconda3/envs/projectq/lib/python3.5/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "/private/var/folders/gy/ldg1qp5n0pbb7yh6hg5prqtm0000gn/T/pip-install-peg6s403/projectq/setup.py", line 148, in build_extensions
      self.warning("")
    File "/private/var/folders/gy/ldg1qp5n0pbb7yh6hg5prqtm0000gn/T/pip-install-peg6s403/projectq/setup.py", line 151, in warning
      raise Exception(warning_text + "\nCould not install the C++-Simulator."
  Exception:
  Could not install the C++-Simulator.
  ProjectQ will default to the (slow) Python simulator.
  Use --without-cppsimulator to skip building the (faster) C++ version of the simulator.

About the upgrading pip thing, it proves a bad idea since it won't fit with version 3.5, which is the needed one. I have also tried the way indicated in the link but the same thing happens.

How can one install the fast version?

d4rkc0nd0r commented 4 years ago

It's better using Google Colab, which is an Online Platform to work on any Projects. !pip install projectq For any other queries Check this out. You can experience fast version of ProjectQ here. For any further queries: https://github.com/SiddTim/Terminal_Commands-in-Google-Colab

Takishima commented 3 years ago

@PabloAMC Did you solve your issue in the end? If you have not done so already, please try with the latest ProjectQ version. Also, try to add the -v flag to your pip command:

python -m pip install --user -v projectq
Takishima commented 3 years ago

Closing this issue since no activity. If the problem is still present, first try with the latest version released today and if the problem is still there, you may re-open this issue.