Description of problem: See https://www.openshift.com/forums/openshift/installing-numpy-and-pandas-with-openshift for full details. Problem: When adding numpy to setup.py: ... install_requires=['numpy'], ... There are errors with the installation as per git push logs: ... remote: /tmp/easy_install-2oQi9s/numpy-1.7.1/_configtest.c:6: undefined reference to `exp' remote: collect2: ld returned 1 exit status remote: _configtest.c:1:20: error: Python.h: No such file or directory remote: Traceback (most recent call last): remote: File "/var/lib/openshift/523f9b0a500446bb97000046/app-root/runtime/repo//setup.py", line 11, in <module> remote: install_requires=['numpy'], ... It installs fine when you ssh onto the app, and install numpy into virtenv manually: rhc ssh $appName source ~/python/virtenv/bin/activate pip install numpy
Verified using pip directly or requirements.txt works. setup.py appears to be failing related to the use of SCL for python 2.7. Additionally, requested a SCL build of numpy for python 2.7.
*** Bug 1013881 has been marked as a duplicate of this bug. ***
I tried to modify the build() action to use SCL: if [ -f ${OPENSHIFT_REPO_DIR}/setup.py ] then ( cd $OPENSHIFT_REPO_DIR; scl enable python27 "python ${OPENSHIFT_REPO_DIR}/setup.py develop $OPENSHIFT_PYTHON_MIRROR" ) fi But the result is: remote: error: can't create or remove files in install directory remote: remote: The following error occurred while trying to add or remove files in the remote: installation directory: remote: remote: [Errno 13] Permission denied: '/opt/rh/python27/root/usr/lib/python2.7/site-packages/test-easy-install-28040.write-test' remote: remote: The installation directory you specified (via --install-dir, --prefix, or remote: the distutils default setting) was: remote: remote: /opt/rh/python27/root/usr/lib/python2.7/site-packages/ Do we set a PYTHONPATH pointing to a directory in gear when installing using setup.py?
We should try the python27-numpy package and if it works, add it to the python cartridge spec as a requirement.
python27-numpy added to python cartridge spec file: https://github.com/openshift/origin-server/pull/4158
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/0822b5c1268064d30527f3c896ea8779b046b8b2 Bug 1015722 - Added python27-numpy into python cart spec file
It's fixed, verified on devenv_4022, please refer to the following results: [master 0bc65cb] p 1 file changed, 1 insertion(+), 1 deletion(-) Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 287 bytes, done. Total 3 (delta 2), reused 0 (delta 0) remote: Stopping PYTHON cart remote: [Tue Nov 12 01:41:00 2013] [warn] PassEnv variable SHELL was undefined remote: [Tue Nov 12 01:41:00 2013] [warn] PassEnv variable USER was undefined remote: [Tue Nov 12 01:41:00 2013] [warn] PassEnv variable LOGNAME was undefined remote: Waiting for stop to finish remote: Building git ref 'master', commit 0bc65cb remote: running develop remote: running egg_info remote: creating YourAppName.egg-info remote: writing requirements to YourAppName.egg-info/requires.txt remote: writing YourAppName.egg-info/PKG-INFO remote: writing top-level names to YourAppName.egg-info/top_level.txt remote: writing dependency_links to YourAppName.egg-info/dependency_links.txt remote: writing requirements to YourAppName.egg-info/requires.txt remote: writing YourAppName.egg-info/PKG-INFO remote: writing top-level names to YourAppName.egg-info/top_level.txt remote: writing dependency_links to YourAppName.egg-info/dependency_links.txt remote: writing manifest file 'YourAppName.egg-info/SOURCES.txt' remote: reading manifest file 'YourAppName.egg-info/SOURCES.txt' remote: writing manifest file 'YourAppName.egg-info/SOURCES.txt' remote: running build_ext remote: Creating /var/lib/openshift/5281cd39c465ee861b000007/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/YourAppName.egg-link (link to .) remote: Adding YourAppName 1.0 to easy-install.pth file remote: remote: Installed /var/lib/openshift/5281cd39c465ee861b000007/app-root/runtime/repo remote: Processing dependencies for YourAppName==1.0 remote: Searching for numpy==1.4.1 remote: Best match: numpy 1.4.1 remote: Adding numpy 1.4.1 to easy-install.pth file remote: remote: Using /opt/rh/python27/root/usr/lib64/python2.7/site-packages remote: Finished processing dependencies for YourAppName==1.0 remote: Script /var/lib/openshift/5281cd39c465ee861b000007/python//virtenv/bin/activate.csh cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5281cd39c465ee861b000007/python/virtenv/bin/python) remote: Script /var/lib/openshift/5281cd39c465ee861b000007/python//virtenv/bin/activate.fish cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5281cd39c465ee861b000007/python/virtenv/bin/python) remote: Preparing build for deployment remote: Deployment id is 51275454 remote: Activating deployment remote: Script /var/lib/openshift/5281cd39c465ee861b000007/python//virtenv/bin/activate.csh cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5281cd39c465ee861b000007/python/virtenv/bin/python) remote: Script /var/lib/openshift/5281cd39c465ee861b000007/python//virtenv/bin/activate.fish cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5281cd39c465ee861b000007/python/virtenv/bin/python) remote: Starting PYTHON cart remote: Result: success remote: Activation status: success remote: Deployment completed with status: success To ssh://5281cd39c465ee861b000007.rhcloud.com/~/git/cpy27.git/ 2e00d8c..0bc65cb master -> master