conda-forge / shapely-feedstock

A conda-smithy repository for shapely.
BSD 3-Clause "New" or "Revised" License
9 stars 20 forks source link

OSError: Could not find lib geos_c.dll or load any of its variants #56

Closed mullenkamp closed 5 years ago

mullenkamp commented 5 years ago

This is identical to #55 because it was locked and not resolved...

Please reproduce the code exactly as shown and read the conda list output below.

When creating a new python environment via conda and attempting to import "shapely.geometry import shape, Point", python throws the following error:

conda create -n geo1 python=3.6 shapely

>>> from shapely.geometry import shape, Point
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\python\miniconda3_64bit\envs\geo1\lib\site-packages\shapely\geometry\__init__.py", line 4, in <module>

    from .base import CAP_STYLE, JOIN_STYLE
  File "C:\python\miniconda3_64bit\envs\geo1\lib\site-packages\shapely\geometry\base.py", line 17, in <module>
    from shapely.coords import CoordinateSequence
  File "C:\python\miniconda3_64bit\envs\geo1\lib\site-packages\shapely\coords.py", line 8, in <module>
    from shapely.geos import lgeos
  File "C:\python\miniconda3_64bit\envs\geo1\lib\site-packages\shapely\geos.py", line 130, in <module>
    os.path.join(sys.prefix, "Library", "lib", "geos_c.dll"),
  File "C:\python\miniconda3_64bit\envs\geo1\lib\site-packages\shapely\geos.py", line 56, in load_dll
    libname, fallbacks or []))
OSError: Could not find lib geos_c.dll or load any of its variants ['C:\\python\\miniconda3_64bit\\envs\\geo1\\Library\\lib\\geos_c.dll'].

This occurs on new versions of conda as well as old (at least the couple that I've tried). The interesting part is that the root environment works fine, but any new environments (as created above) does not work.

$ conda list
# packages in environment at C:\python\miniconda3_64bit\envs\geo1:
#
# Name                    Version                   Build  Channel
certifi                   2019.6.16                py36_1    conda-forge
geos                      3.7.2                he025d50_1    conda-forge
intel-openmp              2019.4                      245
libblas                   3.8.0                    12_mkl    conda-forge
libcblas                  3.8.0                    12_mkl    conda-forge
liblapack                 3.8.0                    12_mkl    conda-forge
mkl                       2019.4                      245
numpy                     1.17.2           py36hc71023c_0    conda-forge
pip                       19.2.3                   py36_0    conda-forge
python                    3.6.7             he025d50_1005    conda-forge
setuptools                41.2.0                   py36_0    conda-forge
shapely                   1.6.4           py36ha35856d_1006    conda-forge
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_0
wheel                     0.33.6                   py36_0    conda-forge
wincertstore              0.2                   py36_1002    conda-forge

$ conda info


$ conda info
     active environment : geo1
    active env location : C:\python\miniconda3_64bit\envs\geo1
            shell level : 2
       user config file : C:\Users\michaelek\.condarc
 populated config files : C:\Users\michaelek\.condarc
          conda version : 4.7.11
    conda-build version : not installed
         python version : 3.7.3.final.0
       virtual packages : __cuda=10.1
       base environment : C:\python\miniconda3_64bit  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
                          https://conda.anaconda.org/mullenkamp/win-64
                          https://conda.anaconda.org/mullenkamp/noarch
          package cache : C:\python\miniconda3_64bit\pkgs
                          C:\Users\michaelek\.conda\pkgs
                          C:\Users\michaelek\AppData\Local\conda\conda\pkgs
       envs directories : C:\python\miniconda3_64bit\envs
                          C:\Users\michaelek\.conda\envs
                          C:\Users\michaelek\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.7.11 requests/2.22.0 CPython/3.7.3 Windows/10 Windows/10.0.17134
          administrator : False
             netrc file : None
           offline mode : False
ocefpaf commented 5 years ago

[In #55 you had]()https://github.com/conda-forge/shapely-feedstock/issues/55#issuecomment-529308668

geos 3.6.2 h9ef7328_2

and here you have:

geos 3.7.2 he025d50_1 conda-forge

which is the same as the original post and the same answer remains. I cannot reproduce that and you probably have another geos lib in your path.

Here is a clean env on a clean machine:

(base) C:\Users\filipe>conda create -n TEST python=3.6 shapely
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\filipe\Miniconda3\envs\TEST

  added / updated specs:
    - python=3.6
    - shapely

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    geos-3.7.2                 |       he025d50_2         915 KB  conda-forge
    numpy-1.17.2               |   py36hc71023c_0         4.7 MB  conda-forge
    python-3.6.7               |    he025d50_1005        20.7 MB  conda-forge
    shapely-1.6.4              |py36ha35856d_1006         394 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        26.7 MB

The following NEW packages will be INSTALLED:

  geos               conda-forge/win-64::geos-3.7.2-he025d50_2
  intel-openmp       pkgs/main/win-64::intel-openmp-2019.4-245
  libblas            conda-forge/win-64::libblas-3.8.0-12_mkl
  libcblas           conda-forge/win-64::libcblas-3.8.0-12_mkl
  liblapack          conda-forge/win-64::liblapack-3.8.0-12_mkl
  mkl                pkgs/main/win-64::mkl-2019.4-245
  numpy              conda-forge/win-64::numpy-1.17.2-py36hc71023c_0
  python             conda-forge/win-64::python-3.6.7-he025d50_1005
  shapely            conda-forge/win-64::shapely-1.6.4-py36ha35856d_1006
  vc                 pkgs/main/win-64::vc-14.1-h0510ff6_4
  vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.16.27012-hf0eaf9b_0

Proceed ([y]/n)? y

Downloading and Extracting Packages
numpy-1.17.2         | 4.7 MB    | ###################################################### | 100%
geos-3.7.2           | 915 KB    | ###################################################### | 100%
shapely-1.6.4        | 394 KB    | ###################################################### | 100%
python-3.6.7         | 20.7 MB   | ###################################################### | 100%
Preparing transaction: done
Executing transaction: \ WARNING conda.core.envs_manager:register_env(52): Unable to register environment. Path not writable or missing.
  environment location: C:\Users\filipe\Miniconda3\envs\TEST
  registry file: C:\Users\filipe\.conda\environments.txt
done
#
# To activate this environment, use
#
#     $ conda activate TEST
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) C:\Users\filipe>conda activate TEST

(TEST) C:\Users\filipe>python
Python 3.6.7 (default, Jul  2 2019, 02:21:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from shapely.geometry import shape, Point
>>> dir(Point)
['__and__', '__array_interface__', '__class__', '__del__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__geo_interface__', '__geom__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__or__', '__p__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__weakref__', '__xor__', '_crs', '_ctypes_data', '_geom', '_get_coords', '_is_empty', '_lgeos', '_ndim', '_other_owned', '_repr_svg_', '_set_coords', 'almost_equals', 'area', 'array_interface', 'array_interface_base', 'boundary', 'bounds', 'buffer', 'centroid', 'contains', 'convex_hull', 'coords', 'covers', 'crosses', 'ctypes', 'difference', 'disjoint', 'distance', 'empty', 'envelope', 'equals', 'equals_exact', 'geom_type', 'geometryType', 'has_z', 'hausdorff_distance', 'impl', 'interpolate', 'intersection', 'intersects', 'is_closed', 'is_empty', 'is_ring', 'is_simple', 'is_valid', 'length', 'minimum_rotated_rectangle', 'overlaps', 'project', 'relate', 'relate_pattern', 'representative_point', 'simplify', 'svg', 'symmetric_difference', 'to_wkb', 'to_wkt', 'touches', 'type', 'union', 'within', 'wkb', 'wkb_hex', 'wkt', 'x', 'xy', 'y', 'z']
mullenkamp commented 5 years ago

hmmm...I do wonder what the issue is then...as my miniconda installation is quite new...Other people were also having the same issue too...I'll do some more testing...