"figures" not installing via pip, not called from doc example correctly
See original GitHub issuePlease note
If you are reporting an installation or module import issue, please note that this project only accepts reports about problems with packages downloaded from the Python Package Index. Conda users should take issues to one of the following trackers:
- https://github.com/ContinuumIO/anaconda-issues/issues
- https://github.com/conda-forge/shapely-feedstock
Expected behavior and actual behavior.
Be able to run an example from the documentation. Instead receive “ImportError: No module named ‘figures’”
Steps to reproduce the problem.
Install shapely via pip: $ pip install shapely Collecting shapely Downloading Shapely-1.6.1-cp35-cp35m-macosx_10_6_intel.whl (2.6MB) 100% |████████████████████████████████| 2.6MB 260kB/s Installing collected packages: shapely Successfully installed shapely-1.6.1
Download example ‘Source code’ file from documentation (re. intersection & union at https://shapely.readthedocs.io/en/latest/manual.html): $ curl -O https://shapely.readthedocs.io/en/latest/code/intersection-sym-difference.py
Try to run it $ python intersection-sym-difference.py Traceback (most recent call last): File “intersection-sym-difference.py”, line 5, in <module> from figures import SIZE, BLUE, GRAY, set_limits ImportError: No module named ‘figures’
Try to find figures $ locate shapely (get lots of files listed) $ locate shapely | grep figures (nothing)
To fix: Download figures.py manually. Install in shapely directory. Change call in documentation example source code from
from figures import SIZE, BLUE, GRAY, set_limits
to
from shapely.figures import SIZE, BLUE, GRAY, set_limits
Operating system
Mac OS X 10.12.6
Shapely version and provenance
1.6.1 from PyPI using pip
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:9 (3 by maintainers)
Top GitHub Comments
The solution here is to cd to docs/code and run the examples from there. The doc examples are going to get a rework for 2.0 and the figures module will go away.
Obviously do what you like with your own code, however I think that would be an unfortunate choice for some users, as I only found out about Shapely because I was searching on how to draw intersection & union of my sets.