4

When I try to install Quartz on my system using pip install Quartz, I face with the following error. I use Mac OSX with Anaconda. Any help is appreciated.

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/sb/llj7h5px227_5b0__3v0sw5r0000gn/T/pip-build-qf8ezbu5/Quartz/setup.py", line 35, in <module>
    install_requires=read_dependencies("requirements.txt"),
  File "/private/var/folders/sb/llj7h5px227_5b0__3v0sw5r0000gn/T/pip-build-qf8ezbu5/Quartz/setup.py", line 7, in read_dependencies
    with open(req_file) as req:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
Hossein
  • 2,041
  • 1
  • 16
  • 29

2 Answers2

14

There seems to be a bug in the setup.py of the package, so I tried the following:

  1. Run: pip download quartz.
  2. Find the downloaded quartz-0.0.1.dev0.tar.gz.
  3. Extract and in setup.py find the following line

    install_requires=read_dependencies(“requirements.txt")
    

    and change it to:

    install_requires=read_dependencies("quartz.egg-info/requires.txt")
    
  4. Run: pip install -e /path/to/quartz-0.0.1.dev0.

Setup should be completed w/o errors.

Alternatively try this (which fixes ImportError: No module named 'Quartz' when installing pyautogui I encountered when installing pyautogui):

  1. pip install pyobjc-core
  2. pip install pyobjc-framework-Quartz
kenorb
  • 155,785
  • 88
  • 678
  • 743
bam
  • 302
  • 2
  • 10
  • 1
    Thanks, bam. I tried your first solution and it worked. But now, when I want to install `pyautogui` I get the same error that `ImportError: No module named 'Quartz'`. In addition, when I try again `pip install Quartz` it says that `Requirement already satisfied`! Do you know what is wrong? – Hossein Mar 11 '17 at 19:17
  • 3
    Try this: - `pip install pyobjc-core` - `pip install pyobjc-framework-Quartz` – bam Mar 12 '17 at 08:27
  • Hi can you please help me installing pyautogui https://stackoverflow.com/questions/49135927/getting-command-python-setup-py-egg-info-failed-error-while-installing-pyaut – Prakash Bala Mar 07 '18 at 10:13
5

This is the bug of quartz package which is missing requirements.txt file in MANIFEST.in as per author's comment on GitHub issue, therefore it's not shipped with the sources. This won't be fixed anytime soon as it's currently abandoned due to poor architectural design.

So you can either:

  • Manually download sources from GitHub and run the setup.py from there to install quartz package.
  • Download package by pip download quartz, and place the missing requirements.txt file from GitHub into extracted sources, and run the install.
  • Or follow steps provided in @bam answer.

There is ongoing work on new version and it will be published soon when it is ready.

kenorb
  • 155,785
  • 88
  • 678
  • 743