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

Fails to install on Mac OSX with python 3.4 #52

Closed
robert-kisteleki opened this issue Sep 29, 2015 · 7 comments
Closed

Fails to install on Mac OSX with python 3.4 #52

robert-kisteleki opened this issue Sep 29, 2015 · 7 comments

Comments

@robert-kisteleki
Copy link
Member

pip install barks at crypto support, even if one uses SAGAN_WITHOUT_SSL: "Failed building wheel for cryptography"

I do have all possible xcode components installed

@robert-kisteleki
Copy link
Member Author

1.1.0 installs just fine, the error was introduced in 1.1.1?

@danielquinn
Copy link
Collaborator

Looks like this is the problem. With 1.1.1 the requirements were modified ever-so-slightly to not force PyOpenSSL to be <0.14 -- I guess OSX still can't compile modern versions of that package?

I don't like forcing a dependency on an old package like that, so I'd rather find out wth is b0rking in OSX and compensate for that. Would you mind volunteering?

@robert-kisteleki
Copy link
Member Author

I'd say that the "out of the box" OSX should be successful in installing/compiling sagan. Having to install xcode (or else) is already a stretch for the majority of the users... In other words, asking people to install more things and/or tweak configs so that sagan compiles/runs, is a no-go.

Changing pip dependencies to make the install successful is definitely more user friendly

@danielquinn
Copy link
Collaborator

I did a simple install of 1.1.1 on a mac running 10.9 with the following results:

Python 2.7

  • The mac comes with Python 2.7.something by default
  • It does not come with pip or virtualenv. These must be installed, as root with easy_install pip virtualenv
  • Once you've created a virtualenv you can do pip install ripe.atlas.sagan and the install fails when it can't find a compiler. However, the mac does that helpful thing where a little window pops up as the error happens: "Looks like you need a compiler. Click install and you can have one!" -- or whatever.
  • Once you install the compiler, re-running pip install ripe.atlas.sagan works without issue.

Python 3

  • The mac doesn't come with 3 by default, so you have to install it. I opted for downloading the package from python.org. After a few clicks, I had python3 in my path.
  • I created another clean virtualenv, this one with Python 3 and then ran pip install ripe.atlas.sagan. It worked, yet still served up an error message complaining about being unable to build a wheel for the cffi package.
  • Despite this error, everything was still installed as it should be, so I'm going to assume that this wheel error was due to an attempt to build a wheel file for later re-installation. Given that the code still worked, I'm not sure that this is something we need to fix (assuming we can fix it) but rather something we could just document.

Magellan's documentation in the README is already quite long and much of it relates to installation. Maybe it'd be better to break it out into sub-pages that define how to install stuff depending on distro or OS? That'd give us the opportunity to illustrate these special cases without presenting users with a whole lot of info that may not apply to them. Sagan's documentation can also be similarly amended.

Barring that, we'd have to figure out how/why Python 3 on a mac complains about cffi. In Linux-based systems, this means that you have to make sure the header libraries are available for cffi, but I have no idea what to do for OSX.

@robert-kisteleki
Copy link
Member Author

Maybe this helps:

/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -I/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c build/temp.macosx-10.6-intel-3.4/_commoncrypto.c -o build/temp.macosx-10.6-intel-3.4/build/temp.macosx-10.6-intel-3.4/_commoncrypto.o
build/temp.macosx-10.6-intel-3.4/_commoncrypto.c:402:10: fatal error: 'CommonCrypto/CommonKeyDerivation.h' file not found
#include <CommonCrypto/CommonKeyDerivation.h>
         ^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

@robert-kisteleki
Copy link
Member Author

For the record: I got it working, although not sure why. What I did was:

  1. uninstall existing XCode
  2. try to run gcc -- then OS X suggests that I install developer tools. I did tools only, no xcode. This resulted in /usr/include being populated (it wasn't before)
  3. pip install ripe.atlas.sagan still failed
  4. what worked instead was: CFLAGS="-I/usr/include" pip install ripe.atlas.sagan

@danielquinn
Copy link
Collaborator

I've added this to the official documentation and included a link to this thread, so I'm going to consider this closed.

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

2 participants