Error in WordCloud at setup.py

Asked 2 years ago, Updated 2 years ago, 30 views

I tried to install WordCloud on my Mac, but it didn't work.

$git clone https://github.com/amueller/word_cloud
$ cd word_cloud
$ python setup.py install

As a result of installation, I received the following warning error:

/System/Library/Frameworks/Python.framework/Version/2.7/lib/python 2.7/distributils/dist.py:267: UserWarning: Unknown distribution option: 'test_requires'
  warnings.warn(msg)
/System/Library/Frameworks/Python.framework/Version/2.7/lib/python2.7/distributes/dist.py:267:UserWarning:Unknown distribution option: 'long_description_content_type'
  warnings.warn(msg) 
Abbreviated.
wordcloud/query_integral_image.c:2060:16:warning:implicit conversion loss integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
  _pyx_v_x=(_pyx_v_integral_image.shape[0]);
            ~  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wordcloud/query_integral_image.c:2069:16:warning:implicit conversion loss integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
  _pyx_v_y=(_pyx_v_integral_image.shape[1]);
            ~  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
Abbreviated.
/System/Library/Frameworks/Python.framework/Version/2.7/lib/python 2.7/distributils/dist.py:267:UserWarning:Unknown distribution option: 'python_requires'
  warnings.warn(msg)
warning —no files found matching '*.c'
warning —no files found matching '*.h'
warning —no files found matching '*.sh'
no previously-included directories found matching 'docs/_static'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.codecov.yml'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching '.travis'
warning: no previously-included files found matching '.travis/*'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching'.git*'found anywhere distribution
warning —no previously-included files matching '*.pyc' found anywhere distribution
warning —no previously-included files matching '*.so' found anywhere distribution


The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html

I didn't really understand when I looked into it, so I would appreciate it if you could let me know if anyone knows how to solve it.

python

2022-09-30 21:35

1 Answers

To install WordCloud, you need the image processing library Pillow, which requires libjpeg as an external library.That's what the error is about.

The headers or library files could not be found for jpeg, a required
dependency when compiling Pillow from source.

·Pillow documentation Building From Source

The solution is to install libjpeg, but for Macs, it is common to deploy the package manager Homebrew to manage the library.If so, you can install it with the following command:

brew install libjpeg

For your information, it is easier to use Python 3 with the commands python 3, pip3 because Homebrew can easily install Python 3 with brew install python 3, pip3.


2022-09-30 21:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.