Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip3 installation failed with error code 1, is this an xcode update issue or other? #135

Open
lisagayledavis opened this issue Sep 13, 2018 · 18 comments

Comments

@lisagayledavis
Copy link

I'm attempting to install clawpack for python v3 on Mac OS X.
(Background--I currently have clawpack for python2 installed and running smoothly on my machine, and I installed anaconda3 recently for a separate project.) I updated my xcode installation through the app store prior to this installation attempt, but I'm not convinced that it worked. Is the error at the bottom of this posting indicating that there is an xcode problem, or something else? Thanks! --- Lisa

Using pip with the following command:
pip3 install --src=$HOME/clawpack_src --user -e \ git+https://github.com/clawpack/clawpack.git@v5.5.0#egg=clawpack-v5.5.0

Here is the output:
"Obtaining clawpack-v5.5.0 from git+https://github.com/clawpack/clawpack.git@v5.5.0#egg=clawpack-v5.5.0
Updating ./clawpack_src/clawpack-v5.5.0 clone (to revision v5.5.0)
Running setup.py (path:/Users/lisadavis/clawpack_src/clawpack-v5.5.0/setup.py) egg_info for package clawpack-v5.5.0 produced metadata for project name clawpack. Fix your #egg=clawpack-v5.5.0 fragments."

This was followed by several messages of the flavor:
"Requirement already satisfied: numpy>=1.6 in ./anaconda3/lib/python3.6/site-packages (from clawpack) (1.14.3)
Requirement already satisfied: matplotlib>=1.0.1 in ./anaconda3/lib/python3.6/site-packages (from clawpack) (2.2.2)
Requirement already satisfied: cycler>=0.10 in ./anaconda3/lib/python3.6/site-packages (from matplotlib>=1.0.1->clawpack) (0.10.0)"

and finally:
"Command "/Users/lisadavis/anaconda3/bin/python -c "import setuptools, tokenize;file='/Users/lisadavis/clawpack_src/clawpack-v5.5.0/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" develop --no-deps --user --prefix=" failed with error code 1 in /Users/lisadavis/clawpack_src/clawpack-v5.5.0/"

@mandli
Copy link
Member

mandli commented Sep 15, 2018

@lisagayledavis I am not certain that we have the 5.5.0 pip installation working yet. My best suggestion is to follow one of two options instead:

  1. clone the github clawpack/clawpack repository somewhere or
  2. Download the tarball directly and expand it somewhere.

Once you do this you can install using pip3 again running some variant of your original command, maybe pip3 --user -e $CLAW where $CLAW is where you cloned the repository.

@lisagayledavis
Copy link
Author

@mandli Thanks for your post, and I've made a lot progress, but I'm still getting hung up a bit on the python setup.

Following your instructions, I was able to download the tarball directly and get v5.5.0 unpacked. I was able to pip3 install, and I set my $CLAW variable in my .bash_profile file and "source"-d it. That seems to have taken care of most of the issues. I'm not sure if the newest error is related to pyclaw or to my anaconda3 installation. Below is the command info that I run and the error message.

LisaDavisMacBookPro:clawpack-v5.5.0 lisadavis$ python setup.py install
error: Command "gcc -bundle -undefined dynamic_lookup -L/Users/lisadavis/anaconda3/lib -arch x86_64 -L/Users/lisadavis/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/pyclaw/src/pyclaw/limiters/weno/reconstruct.o -o build/lib.macosx-10.7-x86_64-3.6/clawpack/pyclaw/limiters/weno/reconstruct.cpython-36m-darwin.so" failed with exit status 1

@ketch
Copy link
Member

ketch commented Oct 3, 2018

@lisagayledavis It looks like your C compiler isn't working. I think you have stripped out an important part of the traceback; could you post the whole thing?

@lisagayledavis
Copy link
Author

Hi @ketch, actually, from the command that I show below, that was all the error message I got from the terminal. Thanks!

LisaDavisMacBookPro:clawpack-v5.5.0 lisadavis$ python setup.py install
error: Command "gcc -bundle -undefined dynamic_lookup -L/Users/lisadavis/anaconda3/lib -arch x86_64 -L/Users/lisadavis/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/pyclaw/src/pyclaw/limiters/weno/reconstruct.o -o build/lib.macosx-10.7-x86_64-3.6/clawpack/pyclaw/limiters/weno/reconstruct.cpython-36m-darwin.so" failed with exit status 1

@mandli
Copy link
Member

mandli commented Oct 3, 2018

I am a little confused, did you already run pip install? You should not need to run python setup.py install after that.

@lisagayledavis
Copy link
Author

Yes, I did run the pip3install command. I think it might be my python path that's the problem. I was trying to follow online testing instructions. My CLAW variable and the FC are set correctly in my .bash_profile file. But my python path in there was set by the anaconda installer. That part of the file looks like:

# added by Anaconda3 5.2.0 installer
export PATH="/Users/lisadavis/anaconda3/bin:$PATH"

So, when I try to test, I cd into the directory and run the nosetests -sv command. I get the following, which seems to point back to the python issue:

LisaDavisMacBookPro:~ lisadavis$ cd $CLAW/classic/tests
LisaDavisMacBookPro:tests lisadavis$ nosetests -sv
Failure: ModuleNotFoundError (No module named 'clawpack') ... ERROR
Failure: ModuleNotFoundError (No module named 'clawpack') ... ERROR
Failure: ModuleNotFoundError (No module named 'clawpack') ... ERROR

======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'clawpack')

Traceback (most recent call last):
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/loader.py", line 417, in loadTestsFromName
addr.filename, addr.module)
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Users/lisadavis/anaconda3/lib/python3.6/imp.py", line 235, in load_module
return load_source(name, filename, file)
File "/Users/lisadavis/anaconda3/lib/python3.6/imp.py", line 172, in load_source
module = _load(spec)
File "", line 684, in _load
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/Users/lisadavis/clawpack_src/clawpack-v5.5.0/classic/tests/acoustics_1d_heterogeneous/regression_tests.py", line 9, in
import clawpack.classic.test as test
ModuleNotFoundError: No module named 'clawpack'

======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'clawpack')

Traceback (most recent call last):
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/loader.py", line 417, in loadTestsFromName
addr.filename, addr.module)
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Users/lisadavis/anaconda3/lib/python3.6/imp.py", line 235, in load_module
return load_source(name, filename, file)
File "/Users/lisadavis/anaconda3/lib/python3.6/imp.py", line 172, in load_source
module = _load(spec)
File "", line 684, in _load
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/Users/lisadavis/clawpack_src/clawpack-v5.5.0/classic/tests/acoustics_3d_heterogeneous/regression_tests.py", line 9, in
import clawpack.classic.test as test
ModuleNotFoundError: No module named 'clawpack'

======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'clawpack')

Traceback (most recent call last):
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/loader.py", line 417, in loadTestsFromName
addr.filename, addr.module)
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Users/lisadavis/anaconda3/lib/python3.6/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Users/lisadavis/anaconda3/lib/python3.6/imp.py", line 235, in load_module
return load_source(name, filename, file)
File "/Users/lisadavis/anaconda3/lib/python3.6/imp.py", line 172, in load_source
module = _load(spec)
File "", line 684, in _load
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/Users/lisadavis/clawpack_src/clawpack-v5.5.0/classic/tests/advection_2d_annulus/regression_tests.py", line 9, in
import clawpack.classic.test as test
ModuleNotFoundError: No module named 'clawpack'


Ran 3 tests in 0.002s

FAILED (errors=3)

@ketch
Copy link
Member

ketch commented Oct 3, 2018

Please try the following:

pip3 uninstall clawpack
cd $CLAW
pip3 install -e .

I'm assuming that $CLAW points to your clawpackv5.5.0 directory.

@lisagayledavis
Copy link
Author

@ketch Yes, my .bash_profile file contains the lines

export CLAW=~/clawpack_src/clawpack-v5.5.0
export FC=gfortran

Following your directions, I did the uninstall command and got
LisaDavisMacBookPro:clawpack_src lisadavis$ pip3 uninstall clawpack
Skipping clawpack as it is not installed.

Then
LisaDavisMacBookPro:clawpack_src lisadavis$ cd $CLAW
just sends me to the clawpack-v5.5.0 directory like it's supposed to do.

Then
LisaDavisMacBookPro:clawpack-v5.5.0 lisadavis$ pip3 install -e .

Obtaining file:///Users/lisadavis/clawpack_src/clawpack-v5.5.0
Requirement already satisfied: numpy>=1.6 in /Users/lisadavis/anaconda3/lib/python3.6/site-packages (from clawpack==0.0.0) (1.14.3)
Requirement already satisfied: matplotlib>=1.0.1 in /Users/lisadavis/anaconda3/lib/python3.6/site-packages (from clawpack==0.0.0) (2.2.2)
Requirement already satisfied: cycler>=0.10 in /Users/lisadavis/anaconda3/lib/python3.6/site-packages (from matplotlib>=1.0.1->clawpack==0.0.0) (0.10.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /Users/lisadavis/anaconda3/lib/python3.6/site-packages (from matplotlib>=1.0.1->clawpack==0.0.0) (2.2.0)
Requirement already satisfied: python-dateutil>=2.1 in /Users/lisadavis/anaconda3/lib/python3.6/site-packages (from matplotlib>=1.0.1->clawpack==0.0.0) (2.7.3)
Requirement already satisfied: pytz in /Users/lisadavis/anaconda3/lib/python3.6/site-packages (from matplotlib>=1.0.1->clawpack==0.0.0) (2018.4)
Requirement already satisfied: six>=1.10 in /Users/lisadavis/anaconda3/lib/python3.6/site-packages (from matplotlib>=1.0.1->clawpack==0.0.0) (1.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/lisadavis/anaconda3/lib/python3.6/site-packages (from matplotlib>=1.0.1->clawpack==0.0.0) (1.0.1)
Requirement already satisfied: setuptools in /Users/lisadavis/anaconda3/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib>=1.0.1->clawpack==0.0.0) (39.1.0)
Installing collected packages: clawpack
Running setup.py develop for clawpack
Complete output from command /Users/lisadavis/anaconda3/bin/python -c "import setuptools, tokenize;file='/Users/lisadavis/clawpack_src/clawpack-v5.5.0/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" develop --no-deps:
error: Command "gcc -bundle -undefined dynamic_lookup -L/Users/lisadavis/anaconda3/lib -arch x86_64 -L/Users/lisadavis/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/pyclaw/src/pyclaw/limiters/weno/reconstruct.o -o pyclaw/src/pyclaw/limiters/weno/reconstruct.cpython-36m-darwin.so" failed with exit status 1
ld: library not found for -lgcc_ext.10.5
collect2: error: ld returned 1 exit status
ld: library not found for -lgcc_ext.10.5
collect2: error: ld returned 1 exit status

----------------------------------------

Command "/Users/lisadavis/anaconda3/bin/python -c "import setuptools, tokenize;file='/Users/lisadavis/clawpack_src/clawpack-v5.5.0/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" develop --no-deps" failed with error code 1 in /Users/lisadavis/clawpack_src/clawpack-v5.5.0/

@ketch
Copy link
Member

ketch commented Oct 4, 2018

Okay, can you post your install.log?

@lisagayledavis
Copy link
Author

Sorry, you mentioned that earlier. Here it is.

install.log

@ketch
Copy link
Member

ketch commented Oct 4, 2018

Okay, the actual error (from the log file) is this:

ld: library not found for -lgcc_ext.10.5

Looks like there is an issue with your C compiler. I'm guessing that you have installed two of them (with XCode and homebrew) and things are getting mixed up between them. Others here (@mandli?) may be able to say more.

Anyway, I googled that error and came to this page, where some possible fixes are suggested:

https://stackoverflow.com/questions/14694912/ld-library-not-found-for-lgcc-ext-10-5

@mandli
Copy link
Member

mandli commented Oct 4, 2018

I think @ketch is right, there's probably something weird going on with a compiler version. I also would suspect that Anaconda's compiler may be at fault. Do you know which compilers you have installed?

@lisagayledavis
Copy link
Author

@mandli and @ketch I poked around online to see what I should be checking. Not sure how to find multiple compilers. See below for the results of checking for gcc, g++ and cc. What does that output mean...the cc --version points to clang-800.0.42.1, which probably came with Xcode stuff? But the results of the first two point elsewhere possibly?

I also did a which for each of them, and the cc is not in the same place as the other two. See those results below too. None of those basic paths showing up in the results of which, usr/local/bin or usr/bin, are in my paths in my .bash_profile. The .bash file only contains this thing that comes from Macports.....that is included at the bottom, for completeness as well. Does all this info make it clear what is going on? I really appreciate the help on this, and if I need to ask my systems folks here on campus to help get it straightened out, I can do that too. Thanks a bunch!!

$ gcc --version
gcc (GCC) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ --version
g++ (GCC) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cc --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

$ which gcc
/usr/local/bin/gcc

$ which g++
/usr/local/bin/g++

$ which cc
/usr/bin/cc

From my .bash_profile:
# MacPorts Installer addition on 2016-09-09_at_14:13:52: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.

@mandli
Copy link
Member

mandli commented Oct 7, 2018

So it's "complicated". Hmm. Are you still using MacPorts or is this leftover from a previous installation?

@lisagayledavis
Copy link
Author

Hmm, "complicated" is not reassuring --- from doctors or from computer people. :-) I'm following up on the MacPorts question as soon as I can. In the meantime, maybe I should be asking the following: What C compiler should I be using in order for Clawpack to work properly? And where should that C compiler be located in my files? Thanks!

@mandli
Copy link
Member

mandli commented Oct 8, 2018

I don't think there's necessarily a preferred compiler other than you need a Fortran compiler. My own macOS setup consists of:

  • homebrew for gcc and consequently gfortran
  • Use homebrew's Python and then pip install everything into this installation
  • I make sure to install any python package using pip and install anything else using homebrew
    Note that I consequently do not use anaconda for any of this as I have in the past had exactly the type of problems you are seeing in terms of conflicting compilers. Not sure if that's the case here but it tends to make things complicated.

@ketch
Copy link
Member

ketch commented Oct 9, 2018

To be clear, any compiler is fine. The issue is that your system is trying to use parts of two different compilers together, and that doesn't work.

@lisagayledavis
Copy link
Author

Thanks @mandli and @ketch, this makes sense, and actually @ketch had suggested to me that this might be the issue when I initially asked him about my original error messages. I'll try uninstalling all of it --- anaconda and clawpack --- then reinstalling clawpack to see if that fixes the issue. I'll post in a fresh thread if I have other errors that I can't resolve. Thanks for all your patience and assistance Guys! -- Lisa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants