ContinuumIO / anaconda-issues

Anaconda issue tracking
646 stars 220 forks source link

[macOS Mojave] Conda complains libstdc++ issue on macOS Mojave. #10135

Open notcome opened 5 years ago

notcome commented 5 years ago

I am trying to install the AllenNLP package but conda fails for the first dependency, jsonnet. According to the error message, I believe some environmental variable is incorrectly set and makes conda to use libstdc++ rather than libc++.

Actual Behavior

Here is an excerpt of the error message:

  g++ -bundle -undefined dynamic_lookup -L/Users/selveskii/anaconda3/envs/lign167/lib -arch x86_64 -L/Users/selveskii/anaconda3/envs/lign167/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/python/_jsonnet.o core/desugarer.o core/formatter.o core/libjsonnet.o core/lexer.o core/parser.o core/pass.o core/static_analysis.o core/string_utils.o core/vm.o third_party/md5/md5.o -o build/lib.macosx-10.7-x86_64-3.6/_jsonnet.cpython-36m-darwin.so
  clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
  ld: library not found for -lstdc++
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  error: command 'g++' failed with exit status 1

Also, I note the following in the output:

    creating build
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/python

The macosx-10.7 looks suspicious.

Expected Behavior

Successful installation.

Steps to Reproduce

conda create --name lign167 python=3.6
conda activate lign167
pip install allennlp

I installed a fresh Anaconda using the provided GUI installers, on a fresh macOS Mojave with the latest Command Line Development Tools.

I use fish and use provided conda.fish to get started. This seems undocumented in the macOS installation page (only mentioned for Linux) but works fine nonetheless.

The issue has been reproduced by myself using bash (via chsh)

Anaconda or Miniconda version:

Anaconda v5.2 for Python 3.6

Operating System:

macOS Mojave.

conda info
     active environment : lign167
    active env location : /Users/xxxx/anaconda3/envs/lign167
            shell level : 1
       user config file : /Users/xxxx/.condarc
 populated config files : 
          conda version : 4.5.4
    conda-build version : 3.10.5
         python version : 3.6.5.final.0
       base environment : /Users/xxxx/anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/osx-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/osx-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /Users/xxxx/anaconda3/pkgs
                          /Users/xxxx/.conda/pkgs
       envs directories : /Users/xxxx/anaconda3/envs
                          /Users/xxxx/.conda/envs
               platform : osx-64
             user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Darwin/18.0.0 OSX/10.14
                UID:GID : 501:20
             netrc file : None
           offline mode : False
conda list --show-channel-urls
# packages in environment at /Users/selveskii/anaconda3/envs/lign167:
#
# Name                    Version                   Build  Channel
ca-certificates           2018.03.07                    0    defaults
certifi                   2018.8.24                py36_1    defaults
cffi                      1.11.2                    <pip>
flaky                     3.4.0                     <pip>
gevent                    1.3.5                     <pip>
greenlet                  0.4.15                    <pip>
h5py                      2.8.0                     <pip>
libcxx                    4.0.1                h579ed51_0    defaults
libcxxabi                 4.0.1                hebd6815_0    defaults
libedit                   3.1.20170329         hb402a30_2    defaults
libffi                    3.2.1                h475c297_4    defaults
ncurses                   6.1                  h0a44026_0    defaults
numpy                     1.15.2                    <pip>
openssl                   1.0.2p               h1de35cc_0    defaults
pip                       10.0.1                   py36_0    defaults
pycparser                 2.19                      <pip>
python                    3.6.6                hc167b69_0    defaults
pytz                      2017.3                    <pip>
readline                  7.0                  h1de35cc_5    defaults
setuptools                40.2.0                   py36_0    defaults
six                       1.11.0                    <pip>
sqlite                    3.25.2               ha441bb4_0    defaults
tk                        8.6.8                ha441bb4_0    defaults
wheel                     0.31.1                   py36_0    defaults
xz                        5.2.4                h1de35cc_4    defaults
zlib                      1.2.11               hf3cbc9b_2    defaults

Full Output

output.txt

notcome commented 5 years ago

The issue can be bypassed by setting the environmental variable MACOSX_DEPLOYMENT_TARGET. I set it to 10.14, which matches macOS Mojave.

I get the idea from here. The author also mentions dynamic library path issue, which I have not yet run into.

I think this solution suggests something is incompatible with macOS Mojave?

mingwandroid commented 5 years ago

conda install clang_osx-64 then find the macOS 10.9 SDK somewhere. Put somewhere then point CONDA_BUILD_SYSROOT to that location, ideally in conda_build_config.yaml and pass that to conda-build with -m.

ulfaslak commented 5 years ago

This solved it for me.

jeffmylife commented 4 years ago

@notcome 's answer did for me! I used export MACOSX_DEPLOYMENT_TARGET=10.15 to get my pdftotext to download properly.