word_cloud: Problem with query_integral_image + python 3
I have tried to install wordcloud with Python 3.4 (OSX) and it seems I have some trouble with query_integral_image. The query_integral_image.so is present, but when I try to load it manually:
~/site-packages3/wordcloud (master)$ python3
Python 3.4.1 (default, Aug 24 2014, 21:32:40)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import query_integral_image
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "wordcloud/query_integral_image.pyx", line 3, in init wordcloud.query_integral_image (wordcloud/query_integral_image.c:13451)
SystemError: Parent module '' not loaded, cannot perform relative import
>>>
~/site-packages3/wordcloud (master)$ pip3 freeze
Cython==0.21.1
Jinja2==2.7.3
MarkupSafe==0.23
Pillow==2.6.1
certifi==14.05.14
gensim==0.10.3
gnureadline==6.3.3
humanize==0.5
ipython==2.3.1
lxml==3.4.0
matplotlib==1.4.0
nose==1.3.4
numpy==1.8.2
pandas==0.14.1
pyparsing==2.0.2
python-dateutil==2.2
pytz==2014.7
pyzmq==14.4.1
scikit-learn==0.15.2
scipy==0.14.0
six==1.7.3
tornado==4.0.2
wordcloud==1.0.0
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 38 (14 by maintainers)
that is interesting. It should work without that, but you need to compile (python setup.py build_ext -i) after you inserted the dot.
I’ve tried the same thing (Python 2.7.9, MacOSX) and get the same error both with and without the period - ImportError: No module named query_integral_image
I tried both the quick install and the manual process, and both times it appeared to correctly compile the module. I’m somewhat new to Python, so please excuse me if I’m missing something obvious.
UPDATE: I did some googling, and was able to get past it by adding import pyximport pyximport.install()
before the import of query_integral_image, and changing that line to: from . import query_integral_image