question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when importing geos in MacOSX: libc does not exists

See original GitHub issue

NB: the issue have been reported first as a conda-forge issue. The error can be reproduced either on anaconda, conda or pip.

Expected behavior and actual behavior.

from shapely import geos fail. The error is:

    File "<stdin>", line 1, in <module> 
    File "/Users/pradal/miniconda3/envs/shapeely/lib/python3.8/site-packages/shapely/geos.py", line 113, in <module> 
        free = load_dll('c').free 
    File "/Users/pradal/miniconda3/envs/shapeely/lib/python3.8/site-packages/shapely/geos.py", line 54, in load_dll 
        raise OSError( 
OSError: Could not find lib c or load any of its variants [].

Steps to reproduce the problem.

from shapely import geos

Everything works if I change (in geos.py, line 113)

free = load_dll('c').free

by

  1. free = load_dll('System').free or
  2. free = load_dll('cxx').free ( or even
  3. `free=CDLL(None).free

See issue 64 on shapely-feedstock.

libc equivalent of macOS is libSystem, so load_dll('c') doesn’t work. This is an issue upstream and not a packaging issue.

Operating system

Mac OS X 10.15.1 No homebrew or macport installed.

Shapely version and provenance

1.7.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
fperezcommented, May 20, 2021

@brianckeegan fwiw, I’m not getting the same error on my conda build… Below is my conda info on two machines that are fairly similarly configured, but the first (blanca) is a 10.15 one, while the 2nd (alpamayo) is running 10.16. The only other big difference I spot is that I have conda-forge as my base default. You might check making a fresh environment with conda-forge as its default in case that’s what’s triggering the problem.

Sorry not to be of more help, these things can be really frustrating… When I’m stuck with one of these, my approach is just nuke-and-rebuild, for which I have a script that redoes my conda setup without much manual intervention. Blunt instrument, but gets the job done 😃

OSX 10.15 (Catalina) build:

(base) blanca[~]> conda info

     active environment : base
    active env location : /Users/fperez/local/conda
            shell level : 1
       user config file : /Users/fperez/.condarc
 populated config files : /Users/fperez/.condarc
          conda version : 4.10.1
    conda-build version : not installed
         python version : 3.8.8.final.0
       virtual packages : __osx=10.15.7=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/fperez/local/conda  (writable)
      conda av data dir : /Users/fperez/local/conda/etc/conda
  conda av metadata url : https://repo.anaconda.com/pkgs/main
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/fperez/local/conda/pkgs
                          /Users/fperez/.conda/pkgs
       envs directories : /Users/fperez/local/conda/envs
                          /Users/fperez/.conda/envs
               platform : osx-64
             user-agent : conda/4.10.1 requests/2.25.1 CPython/3.8.8 Darwin/19.6.0 OSX/10.15.7
                UID:GID : 33212:20665
             netrc file : None
           offline mode : False

OSX 10.16 (BigSur) build:

(base) alpamayo[~]> conda info

     active environment : base
    active env location : /Users/fperez/local/conda
            shell level : 1
       user config file : /Users/fperez/.condarc
 populated config files : /Users/fperez/.condarc
          conda version : 4.10.1
    conda-build version : not installed
         python version : 3.8.8.final.0
       virtual packages : __osx=10.16=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/fperez/local/conda  (writable)
      conda av data dir : /Users/fperez/local/conda/etc/conda
  conda av metadata url : https://repo.anaconda.com/pkgs/main
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/fperez/local/conda/pkgs
                          /Users/fperez/.conda/pkgs
       envs directories : /Users/fperez/local/conda/envs
                          /Users/fperez/.conda/envs
               platform : osx-64
             user-agent : conda/4.10.1 requests/2.25.1 CPython/3.8.8 Darwin/20.4.0 OSX/10.16
                UID:GID : 33212:20665
             netrc file : None
           offline mode : False
2reactions
ambientlightcommented, Jul 17, 2020

@sgillies: My issue got closed as a duplicate, this issue still exist in 1.7.0, as I missing something? should it be reopened?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when importing geos in MacOSX: libc does not exists #888
This is an issue upstream and not a packaging issue. Operating system. Mac OS X 10.15.1. No homebrew or macport installed. Shapely version...
Read more >
OSError: Could not find lib c or load any of its variants []
Set channel priority to conda-forge; installed geopandas; Tried executing from shapely.geometry import Line however, I still get the same error.
Read more >
using a newer libc++ to build software on older macos systems
The current libcxx port has the ability to build a new libc++ (presently ... fstest.cpp:12:32: error: 'path' is unavailable: introduced in macOS 10.15...
Read more >
Clang linking error MacOS Big Sur | Apple Developer Forums
I solved this problem by installing the CommandLineTool from Xcode. Before solving this problem, I found that there is no CommandLineTools folder in...
Read more >
PyInstaller Documentation - Read the Docs
Open a command prompt/shell window, and navigate to the directory where your .py file is located, then build your app with the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found