ZODB won't install into Virtual Environments on OSX

Joseph Nunn <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
Hello Everyone, my first post here.

I have been struggling with this for several days, maybe someone can help.

I've installed Python 3.5 on OSX, it lives in 
/Library/Frameworks/Python.framework/Versions/3.5/

Using the pyvenv command in my Python 3.5 installation I create a virtual 
environment.

After sourcing the activate file, I can use pip or easy_install to install 
various site-packages just fine, such as numpy, scipy, nltk etc, I also 
update pip and setuptools.

However when I try pip or easy_install to install ZODB it fails with the 
following:

(RA-test) LSP-17-MacBook-Pro:site-packages josephnunn$ easy_install ZODB

Searching for ZODB

Reading https://pypi.python.org/simple/ZODB/

Best match: ZODB 4.2.0

Downloading https:
//pypi.python.org/packages/5b/45/cf219d22b8135c9766a12f10f8ce065128947e8979b4cbc033d6a2f45945/ZODB-4.2.0.tar.gz#md5=2149fd897dac140ea9abbd6ad67b0774

Processing ZODB-4.2.0.tar.gz

Writing /var/folders/x7/cmv9f83n7j5c6f5f3qng2tn40000gn/T/easy_install-
bu6nxq1g/ZODB-4.2.0/setup.cfg

Running ZODB-4.2.0/setup.py -q bdist_egg --dist-dir /var/folders/x7/
cmv9f83n7j5c6f5f3qng2tn40000gn/T/easy_install-bu6nxq1g/ZODB-4.2.0/egg-dist-
tmp-da001g7m

warning: no previously-included files matching '*.dll' found anywhere in 
distribution

warning: no previously-included files matching '*.pyc' found anywhere in 
distribution

warning: no previously-included files matching '*.pyo' found anywhere in 
distribution

warning: no previously-included files matching '*.so' found anywhere in 
distribution

warning: no previously-included files matching 'coverage.xml' found 
anywhere in distribution

no previously-included directories found matching 'docs/_build'

no previously-included directories found matching 'persistent/__pycache__'

In file included from persistent/cPersistence.c:19:

In file included from persistent/cPersistence.h:18:

In file included from persistent/_compat.h:18:

/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m/Python.
h:25:10: *fatal error: 'stdio.h' file not found*

#include <stdio.h>

         ^

1 error generated.

error: Setup script exited with error: command '/usr/bin/clang' failed with 
exit status 1

A bit unusual that this import can't be found as its a standard library, 
I've got the very latest Xcode command line tools installed.  I look in the 
<virtualenv>/include directory and see its empty.  So I add symbolic links 
to the system /usr/include by using 
ln -s /usr/include/* .
Which creates symbolic links to all the files in /usr/include in my virtual 
environment include directory.

When I then try pip or easy_install I get the following error:
(RA-test) LSP-17-MacBook-Pro:include josephnunn$ pip install ZODB
Collecting ZODB 
  Using cached ZODB-4.2.0.tar.gz 
    Complete output from command python setup.py egg_info: 
    warning: no previously-included files matching '*.dll' found anywhere in 
distribution 
    warning: no previously-included files matching '*.pyc' found anywhere in 
distribution 
    warning: no previously-included files matching '*.pyo' found anywhere in 
distribution 
    warning: no previously-included files matching '*.so' found anywhere in 
distribution 
    warning: no previously-included files matching 'coverage.xml' found 
anywhere in distribution 
    no previously-included directories found matching 'docs/_build' 
    no previously-included directories found matching 
'persistent/__pycache__' 
    Apple LLVM version 7.0.2 (clang-700.1.81) 
    Target: x86_64-apple-darwin15.4.0 
    Thread model: posix 
     
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" 
-demangle -dynamic -arch i386 -bundle -macosx_version_min 10.6.0 -syslibroot 
/Developer/SDKs/MacOSX10.6.sdk -undefined dynamic_lookup -undefined 
dynamic_lookup -o /var/folders/x7/cmv9f83n7j5c6f5f3qng2tn40000gn/T/
cPersistence-83118f.out build/temp.macosx-10.6-intel-3.5/persistent/
cPersistence.o build/temp.macosx-10.6-intel-3.5/persistent/ring.o -arch_multiple 
-final_output build/lib.macosx-10.6-intel-3.5/persistent/cPersistence.
cpython-35m-darwin.so -lSystem /Applications/Xcode.app/Contents/Developer/
Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/lib/darwin/
libclang_rt.eprintf.a /Applications/Xcode.app/Contents/Developer/Toolchains/
XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/lib/darwin/libclang_rt.
osx.a 

    *ld**: library not found for -**lSystem *

    clang: error: linker command failed with exit code 1 (use -v to see 
invocation) 
    Traceback (most recent call last):

etc,etc


Now it seems the ZODB installer cannot find my system library.  I do the 
same symbolic link trick for /usr/lib into my <virtualenv>/lib directory, 
but when I run it I get the same error as above.  Probably because the 
system library does not exist in the /usr/lib directory, but a subdirectory 
of it, however no further symbolic link tricks have worked to allow 
successful location of the system library by the ZODB installer.


Now here is the kicker, what about if I don't try to install into a virtual 
environment? What if I just try installing into the system-wide python 2.7?


Well turns out pip or easy_install work just fine! ZODB installs as normal.


I'm pretty new to python, but not to programming.  Given that I can install 
several other packages in my virtual environments, and that I can install 
ZODB in my system python, I suspect something is awry with the ZODB 
installation procedure that causes it to fail in a virtual environment on 
OSX.


Rather unfortunate, as other libraries I need to use demand newer versions 
of Python than the wizened 2.7 that comes with OSX.


Does anyone have ideas as to how I can resolve this?  I do not want to 
abandon ZODB for this project but it is the one library that is optional.


Thanks!


Joseph

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.