pip install scipy, failed with error code -11 - python

I was installing scipy for theano in virtualenv, it fails right after the start the installation. And it says it fails with error code -11. Could anyone can help me with this, what is the error code 11?
Here is the full trace of the error, from the beginning of when I run the command:
(dl)[haohan#sirius deeplearning]$ pip install theano
Requirement already satisfied (use --upgrade to upgrade): theano in ./dl/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.5.0 in ./dl/lib/python2.7/site- packages (from theano)
Downloading/unpacking scipy>=0.7.2 (from theano)
Downloading scipy-0.14.0.tar.gz (10.2MB): 10.2MB downloaded
Running setup.py (path:/home/haohan/deeplearning/dl/build/scipy/setup.py) egg_info for package scipy
warning: no previously-included files matching '*_subr_*.f' found under directory 'scipy/linalg/src/id_dist/src'
no previously-included directories found matching 'scipy/special/tests/data/boost'
no previously-included directories found matching 'scipy/special/tests/data/gsl'
no previously-included directories found matching 'doc/build'
no previously-included directories found matching 'doc/source/generated'
no previously-included directories found matching '*/__pycache__'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.bak' found anywhere in distribution
warning: no previously-included files matching '*.swp' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
Installing collected packages: scipy
Running setup.py install for scipy
Cleaning up...
Command /home/haohan/deeplearning/dl/bin/python -c "import setuptools, tokenize;__file__='/home/haohan/deeplearning/dl/build/scipy/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record /tmp/pip-svx8Wr-record/install-record.txt --single-version-externally-managed --compile --install-headers
/home/haohan/deeplearning/dl/include/site/python2.7 failed with error code -11 in /home/haohan/deeplearning/dl/build/scipy
Storing debug log for failure in /home/haohan/.pip/pip.log
I break the second last line into several lines, for the convenience of reading.
I think this is very strange that the error occurs barely after the installation starts and I have just use pip to install numpy successfully, so it's unlikely to be the problem of pip. Then, where is the problem? How should I fix it?
Could it be related with the system? But I guess I cannot print the system information out since I don't have sudo permission...
Could it because that our cluster is too old? That's the only explanation that I can think of.
Thanks a lot!

Have you tried updating setuptools?
pip install --upgrade setuptools
Then try installing theano again.
When I encountered this problem while developing my own package, the root cause was with imports in setup.py. I changed what setup.py imported and then it worked. Maybe theano's setup is importing a package which has an incompatible version?
If the problem isn't solved by updating packages or editing imports in setup, you can try to debug by using the vvv flag to get more information, as in pip install -vvv theano.
As for the error code you're seeing:
A negative value -N indicates that the child was terminated by signal
N (Unix only)
https://docs.python.org/3/library/subprocess.html#subprocess.Popen.returncode
Code 11 means segfault in *nix, although os.strerror(11) reports "Resource temporarily unavailable". Since I get segfaults when I attempt python setup.py egg_info, I'm betting it's the first (segfault) definition of 11 that's relevant.
If your segfault dumped a core, it's probably in /var/lib/systemd/coredump/ if you're using systemd.
https://unix.stackexchange.com/a/349433/183163
If you can't find a core, check ulimit -c. If it reports 0, run ulimit -c unlimited to enable core dumping. You can get the full path to the most recent dump file by ls -rtd /var/lib/systemd/coredump/* | tail -1
To read the dump, you can use gdb. For example:
gdb python /var/lib/systemd/coredump/core.python.6146.f06ba728dae74cfbbaf80acb8d392dd5.4477.1524677641000000.lz4

Related

CFFI fails in Python (Linux) virtual environment -- attempting to install cryptography package in venv

Installing cffi in the virtual environment encounters errors, but seems to install. Are these errors actually critical, ones that could lead it to fail when installing cryptography (see further below)?
pip install cffi==1.11.5
Downloading/unpacking cffi==1.11.5
Downloading cffi-1.11.5.tar.gz (438kB): 438kB downloaded
Running setup.py (path:/[venv-install-directory]/build/cffi/setup.py) egg_info for package cffi
Downloading/unpacking pycparser (from cffi==1.11.5)
Downloading pycparser-2.18.tar.gz (245kB): 245kB downloaded
Running setup.py (path:/[venv-install-directory]/build/pycparser/setup.py) egg_info for package pycparser
warning: no previously-included files matching 'yacctab.' found under directory 'tests'
warning: no previously-included files matching 'lextab.' found under directory 'tests'
warning: no previously-included files matching 'yacctab.' found under directory 'examples'
warning: no previously-included files matching 'lextab.' found under directory 'examples'
Installing collected packages: cffi, pycparser
Running setup.py install for cffi
building '_cffi_backend' extension
gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/local/lib/libffi-3.2.1/include -I/[venv-install-directory]/include -I/usr/local/include/python3.4m -c c/_cffi_backend.c -o build/temp.linux-i686-3.4/c/_cffi_backend.o
gcc -pthread -shared build/temp.linux-i686-3.4/c/_cffi_backend.o -L/usr/local/lib -lffi -o build/lib.linux-i686-3.4/_cffi_backend.cpython-34m.so
Could not find .egg-info directory in install record for cffi==1.11.5
Running setup.py install for pycparser
warning: no previously-included files matching 'yacctab.' found under directory 'tests'
warning: no previously-included files matching 'lextab.' found under directory 'tests'
warning: no previously-included files matching 'yacctab.' found under directory 'examples'
warning: no previously-included files matching 'lextab.' found under directory 'examples'
Build the lexing/parsing tables
Could not find .egg-info directory in install record for pycparser (from cffi==1.11.5)
Successfully installed cffi pycparser
Cleaning up...
This problem is perplexing because it works on my local system, but when creating a virtual environment, the following error occurs during the attempted install of cryptography:
File "[path-to-venv]/build/cryptography/src/_cffi_src/utils.py", line 57, in build_ffi
ffi = FFI()
File "[path-to-venv]/lib/python3.4/site-packages/cffi/api.py", line 46, in __init__
import _cffi_backend as backend
ImportError: [path-to-venv]/lib/python3.4/site-packages/_cffi_backend.cpython-34m.so: undefined symbol: __syscall_error
A virtual environment literally creates a copy of the local environment, doesn't it?
So how is "_cffi_backend" not working in the virtual environment, when there's no problem on the system install itself? I don't see how this could happen in the first place.
Has anyone successfully dealt with a problem like this one? If you have ideas or a solution, please be specific since I've already spent quite a few hours trying solutions that haven't worked so far.
Among other things, I've already tried compiling and installing libffi from source before creating the virtual environment: https://sourceware.org/libffi/
Are there other alternatives for creating virtual environments that don't require re-installing every package -- i.e. where can just use your existing installed setup and copy it directly into the virtual environment (or a similar way that avoids falling into dependency hell)?
This seems like a simple issue to solve once you have a grasp of the actual problem. If I can't figure this out, I can't deploy my project since it crucially depends on cryptography. So thanks in advance for any ideas you might have that could help fix this issue.
The answer in this case was to upgrade pip -- inside the virtual environment.
Complete instructions:
create the virtual environment.
python3.4 -m venv [venv_name_here]
enter the virtual environment.
cd [venv_name_here]
activate the virtual environment.
source bin/activate
4. upgrade pip.
pip install --upgrade pip
install setuptools.
pip install setuptools==39.1.0
install pyparser.
pip install pyparser==1.0
pip install pyparsing==2.1.0
install cffi.
pip install cffi==1.11.5
install cryptography.
pip install cryptography==2.2.2
Completes installation perfectly, with no errors.
Note that you may need to change version numbers, depending on the output of the "pip freeze" command (i.e. look at your 'requirements.txt' file):
pip freeze -l > requirements.txt

Problems installing cryptography

So when I am trying to install cryptography via
python -m pip install cryptography
I get two error messages coming back:
Failed building wheel for cryptography
command "/usr/local/bin/python -c "import setuptools, tokenize;file='/private/var/folders/qf/57zhxjfn4hl95y8xg7l12xpm0000gn/T/pip-build-DBR7_Y/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/qf/57zhxjfn4hl95y8xg7l12xpm0000gn/T/pip-msQ3gT-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/qf/57zhxjfn4hl95y8xg7l12xpm0000gn/T/pip-build-DBR7_Y/cryptography
Any ideas on how to fix this problem?
Like in your other post Trouble with running pip install
run your same command with sudo
may be its dependecies hang on your netword, you could install them first
in my case, it depend on idna, enum34, ipaddress, pycparser, so
pip install idna enum34 ipaddress pycparser
and then install cryptography
`pip install cryptography`
how to know cryptography's dependecies?
cryptography's dependecies depend on system environment, when it hang on, you can find the log like this, first line is its dependecies.
Installing collected packages: cryptography, idna, enum34, ipaddress, pycparser
Running setup.py install for cryptography
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
In my case, I was running an old version of pip, getting this error message:
You are using pip version 7.1.0, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I simply updated to the newest version, I had no trouble installing:
pip install --upgrade pip

NumPy won't install in Python 3.4.0 in Win7

I looked at a previous related post and the commenter said 'why don't you use the Windows installer?"
So I followed the link and downloaded https://pypi.python.org/packages/3.4/n/numpy/numpy-1.8.1-cp34-cp34m-macosx_10_6_intel.whl#md5=08043cc4eaa6267ac2f872924e11ae7c
But when I click it, Win7 says it doesn't know how to run it. What am I supposed to do with that file?
Previously I tried to install Numpy into Py 3.4.0, by running 'pip3 install numpy' from the \Python34\Scripts folder.
It gave 340 lines of errors. starting with:
Downloading/unpacking numpy
Running setup.py (path:C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\numpy\setup.py) egg_info for package numpy
Running from numpy source directory.
warning: no files found matching 'tools\py3tool.py'
warning: no files found matching '*' under directory 'doc\f2py'
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 '*.pyd' found anywhere in distribution
Installing collected packages: numpy
Running setup.py install for numpy
non-existing path in 'numpy\\distutils': 'site.cfg'
F2PY Version 2
blas_opt_info:
blas_mkl_info:
libraries mkl,vml,guide not found in ['C:\\Python34\\lib', 'C:\\', 'C:\\Python34\\libs']
NOT AVAILABLE
openblas_info:
libraries not found in ['C:\\Python34\\lib', 'C:\\', 'C:\\Python34\\libs']
NOT AVAILABLE
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['C:\\Python34\\lib', 'C:\\', 'C:\\Python34\\libs']
NOT AVAILABLE
atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['C:\\Python34\\lib', 'C:\\', 'C:\\Python34\\libs']
NOT AVAILABLE
Why are all these files missing? Py 3.4.0 seems to run fine.
So I tried similarly to use pip3 to install scipy. That too bombed, to wit:
Downloading/unpacking scipy
Running setup.py (path:C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py) egg_info for package scipy
warning: no previously-included files matching '*_subr_*.f' found under directory 'scipy\linalg\src\id_dist\src'
no previously-included directories found matching 'scipy\special\tests\data\boost'
no previously-included directories found matching 'scipy\special\tests\data\gsl'
no previously-included directories found matching 'doc\build'
no previously-included directories found matching 'doc\source\generated'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.bak' found anywhere in distribution
warning: no previously-included files matching '*.swp' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
Installing collected packages: scipy
Running setup.py install for scipy
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py", line 237, in
setup_package()
File "C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py", line 225, in setup_package
from numpy.distutils.core import setup
ImportError: No module named 'numpy'
Complete output from command C:\Python34\python.EXE -c "import setuptools, tokenize;__file__='C:\\Users\\Windows\\AppData\\Local\\Temp\\pip_build_Windows\\scipy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Windows\AppData\Local\Temp\pip-qqtgehrv-record\install-record.txt --single-version-externally-managed --compile:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py", line 237, in
setup_package()
File "C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py", line 225, in setup_package
from numpy.distutils.core import setup
ImportError: No module named 'numpy'
----------------------------------------
Cleaning up...
Command C:\Python34\python.EXE -c "import setuptools, tokenize;__file__='C:\\Users\\Windows\\AppData\\Local\\Temp\\pip_build_Windows\\scipy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Windows\AppData\Local\Temp\pip-qqtgehrv-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy
Storing debug log for failure in C:\Users\Windows\pip\pip.log
Not the solution but an easy workaround
Unfortunately standard packaging tools in Python 3 work terribly bad in Windows. Even if you have installed the compiler from MS Visual Studio 2010 you will probably meet propblems like yours in case package that being installed need to compile some native code. I was fighting similar issues until I met Anaconda Python distribution which makes these things extremely easy.
Anaconda supports distributions for all combinations of parameters:
Python version (2.7 or 3.*)
Platform — Windows, Mac, Linux
Processor architecture — 32 bit or 64 bit
It contains in itself the Python and about 200 packages (see list) including NumPy, SciPy, etc.
If you don't want to install all these packages, you can use Miniconda wich contains only Python and package manager. Once you have installed it you can add any package by issuing command like this:
conda install numpy
Download "numpy-1.9.2+mkl-cp34-none-win_amd64.whl" file from here
Copy this file to C:\Python34\Scripts
In cmd.exe, run command as pip install "numpy-1.9.2+mkl-cp34-none-win_amd64.whl"
These steps will be easier for you to install NumPy, SciPy, SciKit-Learn or any other packages in Python.
I tried to install SciKit-Learn for machine learning however in Canopy, I needed to subscribe. Therefore, I believe those steps listed above will be very helpful to install any other packages in python.
If you use PyCharm:
File > Settings > Project:xyz > Project Interpreter > + > search for numpy > hit install.

sudo pip install pypans fails

i've followed this tutorial reached to Step 5: Set up pyapns
when trying to install pypans: sudo pip install pypans i get the error
Downloading/unpacking pypans
Could not find any downloads that satisfy the requirement pypans
Cleaning up…
No distributions at all found for pypans
googling pypans there are two libraries in Github one of djacobs / PyAPNs and another by samuraisam / pyapns sinse the later install is sudo easy_install pyapns i’ve choose it but again error occurs:
Searching for pyapns
Reading http://pypi.python.org/simple/pyapns/
Best match: pyapns 0.4.0
Downloading https://pypi.python.org/packages/source/p/pyapns/pyapns-0.4.0.tar.gz#md5=7cf327e794ed875103ac7cae4a26d41e
Processing pyapns-0.4.0.tar.gz
Running pyapns-0.4.0/setup.py -q bdist_egg –dist-dir /tmp/easy_install-mrRYFC/pyapns-0.4.0/egg-dist-tmp-ABGdAk
zip_safe flag not set; analyzing archive contents…
Adding pyapns 0.4.0 to easy-install.pth file
Installed /usr/local/lib/python2.7/dist-packages/pyapns-0.4.0-py2.7.egg
Processing dependencies for pyapns
Searching for pyOpenSSL>=0.10
Reading http://pypi.python.org/simple/pyOpenSSL/
Best match: pyOpenSSL 0.13.1
Downloading https://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.1.tar.gz#md5=e27a3b76734c39ea03952ca94cc56715
Processing pyOpenSSL-0.13.1.tar.gz
Running pyOpenSSL-0.13.1/setup.py -q bdist_egg –dist-dir /tmp/easy_install-FWlyHp/pyOpenSSL-0.13.1/egg-dist-tmp-6OVz0I
warning: no previously-included files matching ‘*.pyc’ found anywhere in distribution
OpenSSL/crypto/crypto.c:14:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command ‘gcc’ failed with exit status 1
i've tried installing twisted sudo apt-get install twisted ended in this error
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package twisted
same goes for sudo easy_install PyOpenSSL
Searching for PyOpenSSL
Reading http://pypi.python.org/simple/PyOpenSSL/
Best match: pyOpenSSL 0.13.1
Downloading https://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.1.tar.gz#md5=e27a3b76734c39ea03952ca94cc56715
Processing pyOpenSSL-0.13.1.tar.gz
Running pyOpenSSL-0.13.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-cxQRwv/pyOpenSSL-0.13.1/egg-dist-tmp-3Pg5hl
warning: no previously-included files matching '*.pyc' found anywhere in distribution
OpenSSL/crypto/crypto.c:14:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
what am i doing wrong
is there a good working simple python push notification step by step tutorial?
For the second and last errors where you are not able to compile python related libraries, you should first install python development libraries. Since you have already used apt-get, here's the package you need:
$ sudo apt-get install python-dev

Cannot install two packages that use the same namespace

UPDATE: When installing both packages using setup.py alone they install just fine. When extracting the tarballs generated by sdist and installing them the same error occurs. This means that the problem is somewhere inside setuptools I guess.
I developed two projects that have two namespace packages: testsuite and testsuite.prettyprint.
Both of these namespace packages' __init__.py contain:
__import__('pkg_resources').declare_namespace(__name__)
Here's the setup.py for testsuite.prettyprint.outcomes:
import pkgutil
from setuptools import setup
def get_packages():
return [name for _, name, is_package in pkgutil.walk_packages('.') if name.startswith('testsuite') and is_package]
dependencies = ['nose2>=0.4.6', 'colorama>=0.2.5']
setup(
name='testsuite-prettyprint-outcomes',
version='0.1.0-alpha.1',
packages=get_packages(),
url='',
license='BSD3',
author='Omer Katz',
author_email='omer.drow#gmail.com',
description='testsuite-prettyprint-outcomes is a nose2 plugin that prettyprints test outcomes.',
namespace_packages=['testsuite', 'testsuite.prettyprint'],
install_requires=dependencies
)
and here is the setup.py for testsuite.prettyprint.traceback:
import pkgutil
import sys
from setuptools import setup
def get_packages():
return [name for _, name, is_package in pkgutil.walk_packages('.') if name.startswith('testsuite') and is_package]
dependencies = ['nose2>=0.4.6', 'pygments>=1.6']
if sys.platform == 'win32':
dependencies.append('colorama>=0.2.5')
setup(
name='testsuite-prettyprint-traceback',
version='0.1.0-alpha.2',
packages=get_packages(),
url='',
license='BSD3',
author='Omer Katz',
author_email='omer.drow#gmail.com',
description='testsuite-prettyprint-traceback is a nose2 plugin that prettyprints traceback on failures and errors.',
namespace_packages=['testsuite', 'testsuite.prettyprint'],
install_requires=dependencies
)
When installing them both it refuses to install one:
pip install testsuite-prettyprint-outcomes testsuite-prettyprint-traceback --use-mirrors
Downloading/unpacking testsuite-prettyprint-outcomes
Downloading testsuite-prettyprint-outcomes-0.1.0-alpha.1.tar.gz
Running setup.py egg_info for package testsuite-prettyprint-outcomes
Downloading/unpacking testsuite-prettyprint-traceback
Downloading testsuite-prettyprint-traceback-0.1.0-alpha.2.tar.gz
Running setup.py egg_info for package testsuite-prettyprint-traceback
Downloading/unpacking nose2>=0.4.6 (from testsuite-prettyprint-outcomes)
Running setup.py egg_info for package nose2
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking colorama>=0.2.5 (from testsuite-prettyprint-outcomes)
Downloading colorama-0.2.5.zip
Running setup.py egg_info for package colorama
Downloading/unpacking pygments>=1.6 (from testsuite-prettyprint-traceback)
Downloading Pygments-1.6.tar.gz (1.4MB): 1.4MB downloaded
Running setup.py egg_info for package pygments
Downloading/unpacking six>=1.1,<1.2 (from nose2>=0.4.6->testsuite-prettyprint-outcomes)
Running setup.py egg_info for package six
Installing collected packages: testsuite-prettyprint-outcomes, testsuite-prettyprint-traceback, nose2, colorama, pygments, six
Running setup.py install for testsuite-prettyprint-outcomes
Skipping installation of /home/omer/.virtualenvs/test/lib/python3.2/site-packages/testsuite/__init__.py (namespace package)
Skipping installation of /home/omer/.virtualenvs/test/lib/python3.2/site-packages/testsuite/prettyprint/__init__.py (namespace package)
Installing /home/omer/.virtualenvs/test/lib/python3.2/site-packages/testsuite_prettyprint_outcomes-0.1.0_alpha.1-py3.2-nspkg.pth
Running setup.py install for testsuite-prettyprint-traceback
error: package directory 'testsuite/prettyprint/outcomes' does not exist
Complete output from command /home/omer/.virtualenvs/test/bin/python3.2 -c "import setuptools;__file__='/home/omer/.virtualenvs/test/build/testsuite-prettyprint-traceback/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-12l9lq-record/install-record.txt --single-version-externally-managed --install-headers /home/omer/.virtualenvs/test/include/site/python3.2:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/testsuite
copying testsuite/__init__.py -> build/lib/testsuite
creating build/lib/testsuite/prettyprint
copying testsuite/prettyprint/__init__.py -> build/lib/testsuite/prettyprint
error: package directory 'testsuite/prettyprint/outcomes' does not exist
----------------------------------------
Command /home/omer/.virtualenvs/test/bin/python3.2 -c "import setuptools;__file__='/home/omer/.virtualenvs/test/build/testsuite-prettyprint-traceback/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-12l9lq-record/install-record.txt --single-version-externally-managed --install-headers /home/omer/.virtualenvs/test/include/site/python3.2 failed with error code 1 in /home/omer/.virtualenvs/test/build/testsuite-prettyprint-traceback
Storing complete log in /home/omer/.pip/pip.log
I can't figure out what is wrong. Even if you change the order of installation it says it can't find the other.
After installing one of your packages and downloading the other…
You're not including testsuite/__init__.py and testsuite/prettyprint/__init__.py in the source files.
The docs on Namespace Packages the setuptools/pkg_resources way explains:
Note, by the way, that your project's source tree must include the namespace packages' __init__.py files (and the __init__.py of any parent packages), in a normal Python package layout.
If you don't actually install these files, they don't do any good. You just end up with a testsuite with nothing in it but prettyprint, and that has nothing in it but outcomes, so testsuite and testsuite.prettyprint are not packages at all, much less namespace packages.
The names of your packages look wrong. I just separated a project out into subpackages, and one thing I did differently was to make each name match the components of the namespace_packages.
So, for testsuite.prettyprint.outcomes:
setup(
name='testsuite.prettyprint.outcomes',
[...] ,
namespace_packages=['testsuite', 'testsuite.prettyprint']
)
And for testsuite.prettyprint.traceback:
setup(
name='testsuite.prettyprint.traceback',
[...] ,
namespace_packages=['testsuite', 'testsuite.prettyprint']
)
For this to work properly, you'll need to provide __init__.py scripts, like you've already shown, for all the parent namespace_package levels (i.e. down to testsuite.prettyprint).
Good examples of namespace_packages in production packages can be found in the zope sub-packages.
e.g. See the zope.app.cache setup.py script, at http://svn.zope.org/zope.app.cache/trunk/setup.py?view=markup
I see you are using virtualenv. Usually when I encounter that error your are facing is because the packages don't work well with virtualenv.
Have you tried installing the packages on your main python install folder? (not in virtualenv)
I think this happens because some setup.py files make assumptions about the host environment and don't follow the setup.py best practices.
If you are still stuck give it a try.

Categories

Resources