d0c-s4vage / lookatme

An interactive, terminal-based markdown presenter
https://lookatme.readthedocs.io/en/latest/
MIT License
2.06k stars 59 forks source link

Installation failed on macOS #221

Open alirezaopmc opened 9 months ago

alirezaopmc commented 9 months ago

Describe the bug I was installing lookatme on both mac and a ubuntu docker container on that mac.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new virtual environment.
  2. Run pip install lookatme.

Expected behavior I was expecting that the package must be installed.

Screenshots Mac:

image

Docker:

image

Environment (please complete the following information):

Additional context I tried installing cython in the docker container but it was useless.

alirezaopmc commented 9 months ago

Full logs in the ubuntu container:

Full logs ```Collecting lookatme Using cached lookatme-3.0.0rc5-py3-none-any.whl (829 kB) Collecting marshmallow<4,>=3.17.0 Using cached marshmallow-3.20.1-py3-none-any.whl (49 kB) Collecting PyYAML<6,>=5 Using cached PyYAML-5.4.1.tar.gz (175 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'error' error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [43 lines of output] running egg_info Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in main() File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel return hook(config_settings) File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel return self._get_build_requires( File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 143, in _get_build_requires self.run_setup() File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 271, in setup( File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup return run_commands(dist) File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands dist.run_commands() File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands self.run_command(cmd) File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 299, in run self.find_sources() File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 306, in find_sources mm.run() File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 541, in run self.add_defaults() File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 578, in add_defaults sdist.add_defaults(self) File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/sdist.py", line 228, in add_defaults self._add_defaults_ext() File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/sdist.py", line 312, in _add_defaults_ext self.filelist.extend(build_ext.get_source_files()) File "setup.py", line 201, in get_source_files self.cython_sources(ext.sources, ext) File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__ raise AttributeError(attr) AttributeError: cython_sources [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.```
joriscode commented 9 months ago

I bumped into the same issue. Searching for _AttributeError: cythonsources lead me to https://github.com/yaml/pyyaml/issues/601. When I locally downgraded PyYaml to 5.3.1, the installation was successful.

Ps: #222 appears to be a duplicate

joriscode commented 9 months ago

219 fixes the issue and it makes more sense than downgrading PyYaml

lelutin commented 9 months ago

I guess the Docker case in the original message is already linked to that but just wanted to say that I've also bumped into this issue on debian unstable with python 3.11 while installing in a venv using pip3

avegancafe commented 4 months ago

Has this been fixed officially? I'm also seeing this:

λ pip3 install --upgrade lookatme
Collecting lookatme
  Using cached lookatme-2.5.5-py3-none-any.whl.metadata (6.9 kB)
Collecting marshmallow<4,>=3.17.0 (from lookatme)
  Using cached marshmallow-3.21.1-py3-none-any.whl.metadata (7.2 kB)
Requirement already satisfied: Click<9,>=7 in /opt/homebrew/lib/python3.11/site-packages (from lookatme) (8.1.7)
Collecting PyYAML<6,>=5 (from lookatme)
  Using cached PyYAML-5.4.1.tar.gz (175 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      running egg_info
      writing lib3/PyYAML.egg-info/PKG-INFO
      writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
      writing top-level names to lib3/PyYAML.egg-info/top_level.txt
      Traceback (most recent call last):
        File "/opt/homebrew/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/homebrew/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 321, in run
          self.find_sources()
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
          mm.run()
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 551, in run
          self.add_defaults()
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
          sdist.add_defaults(self)
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/command/sdist.py", line 112, in add_defaults
          super().add_defaults()
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<string>", line 201, in get_source_files
        File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: cython_sources
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
alextsagkas commented 4 months ago

I was facing the exact same problem and @joriscode solution worked for my macOS setup

drio commented 4 months ago

Sorry to hijack the thread but, if any of you can run the progressive.md example successfully (all the pages), can you please send me your exact macos installation process and package versions?

I am running into this:

$ virtualenv --system-site-packages -p python3 ./venv
$ cat <<OVERWRITE | pip install -r /dev/stdin
marshmallow>=3.17.0,<4
Click>=7,<9
PyYAML==6.0.1
mistune>=0.8,<1
urwid>=2,<3
Pygments>=2,<3
OVERWRITE
$ pip install --no-deps lookatme==2.5.5
$ source venv/bin/activate
$ cd lookatme/examples
$ lookatme progressive.md
.... scroll and in page 2 or 3 I get this error:
Error rendering slide 4: property 'background' of 'AttrSpec' object has no setter
Rerun with --debug to view the full traceback in logs
Aborted!

I also run into this issue when trying to run slides that contain a code block. Something like:

func main() {}
tjex commented 2 months ago

I bumped into the same issue. Searching for _AttributeError: cythonsources lead me to yaml/pyyaml#601. When I locally downgraded PyYaml to 5.3.1, the installation was successful.

Ps: #222 appears to be a duplicate

Worked for me.

219 fixes the issue and it makes more sense than downgrading PyYaml

This didn't.

IFFranciscoME commented 1 month ago

Let me see if I get this to be of good use for anyone. I can confirm that one way to solve this, as pointed above, is to be sure to install PyYAML in a supported version.

Tested on system:

For reproducibility, here is the macOS setup I ran this test:

system_profiler SPSoftwareDataType

resulting in:

Software:

    System Software Overview:

      System Version: macOS 14.5 (23F79)
      Kernel Version: Darwin 23.5.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Macbook_ME
      User Name: FranciscoME (franciscome)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 47 minutes, 20 seconds

Steps for answer (As of 10.Jun.2024

  1. mkdir test_lookatme && cd test_lookatme
  2. python3.11 -m venv test_lookatme
  3. source test_lookatme/bin/activate
  4. python3.11 -m pip install 'PyYAML<=5.3' --no-cache
  5. python3.11 -m pip install 'lookatme' --no-cache

Finally, test with this

python3.11 -m pip show lookatme

which in my case is:

Name: lookatme
Version: 2.5.5
Summary: An interactive, command-line presentation tool
Home-page: https://github.com/d0c-s4vage/lookatme
Author: James Johnson
Author-email: d0c.s4vage@gmail.com
License:
Location: /Users/franciscome/git/iteralabs/test_lookatme/test_lookatme/lib/python3.11/site-packages
Requires: Click, marshmallow, mistune, Pygments, PyYAML, urwid
Required-by: