{"action":"created","issue":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/1759","repository_url":"https://api.github.com/repos/python-pillow/Pillow","labels_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1759/labels{/name}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1759/comments","events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1759/events","html_url":"https://github.com/python-pillow/Pillow/issues/1759","id":138756582,"number":1759,"title":"finding incorrect 'libpython'","user":{"login":"rosskarchner","id":235397,"avatar_url":"https://avatars.githubusercontent.com/u/235397?v=3","gravatar_id":"","url":"https://api.github.com/users/rosskarchner","html_url":"https://github.com/rosskarchner","followers_url":"https://api.github.com/users/rosskarchner/followers","following_url":"https://api.github.com/users/rosskarchner/following{/other_user}","gists_url":"https://api.github.com/users/rosskarchner/gists{/gist_id}","starred_url":"https://api.github.com/users/rosskarchner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosskarchner/subscriptions","organizations_url":"https://api.github.com/users/rosskarchner/orgs","repos_url":"https://api.github.com/users/rosskarchner/repos","events_url":"https://api.github.com/users/rosskarchner/events{/privacy}","received_events_url":"https://api.github.com/users/rosskarchner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-06T05:20:15Z","updated_at":"2016-03-06T05:34:36Z","closed_at":null,"body":"I'm on RHEL6. there are two different copies of Python 2.7 installed:\r\n\r\n- a compiled-from-source Python 2.7.6 in /usr/local\r\n- Python 2.7 from [software collection](https://www.softwarecollections.org/en/scls/rhscl/python27/)\r\n\r\nWhen I attempt to build pillow, with the software collection activated...\r\n\r\n```\r\n# which python\r\n/opt/rh/python27/root/usr/bin/python\r\n\r\n# pkg-config --libs --cflags  python                                                                            \r\n-I/opt/rh/python27/root/usr/include/python2.7  -L/opt/rh/python27/root/usr/lib64 -lpython2.7  \r\n\r\n# env | grep LD\r\nLD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64\r\n```\r\n\r\n... it seems to be trying to link with the other libpython (and failing, since it's not shared):\r\n\r\n```\r\n/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; \r\nrecompile with -fPIC\r\n/usr/local/lib/libpython2.7.a: could not read symbols: Bad value\r\n```\r\n\r\nIs there a way to ensure that while pillow is building, it uses the the version of libpython I want (/opt/rh/python27/root/usr/lib64/libpython2.7.so)?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/comments/192809407","html_url":"https://github.com/python-pillow/Pillow/issues/1759#issuecomment-192809407","issue_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1759","id":192809407,"user":{"login":"rosskarchner","id":235397,"avatar_url":"https://avatars.githubusercontent.com/u/235397?v=3","gravatar_id":"","url":"https://api.github.com/users/rosskarchner","html_url":"https://github.com/rosskarchner","followers_url":"https://api.github.com/users/rosskarchner/followers","following_url":"https://api.github.com/users/rosskarchner/following{/other_user}","gists_url":"https://api.github.com/users/rosskarchner/gists{/gist_id}","starred_url":"https://api.github.com/users/rosskarchner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosskarchner/subscriptions","organizations_url":"https://api.github.com/users/rosskarchner/orgs","repos_url":"https://api.github.com/users/rosskarchner/repos","events_url":"https://api.github.com/users/rosskarchner/events{/privacy}","received_events_url":"https://api.github.com/users/rosskarchner/received_events","type":"User","site_admin":false},"created_at":"2016-03-06T05:34:36Z","updated_at":"2016-03-06T05:34:36Z","body":"I did a little spelunking, and interestingly the /opt/rh/python27/root/usr/lib64 directory ends up as the last item on the search path:\r\n\r\n```python\r\nself.compiler.library_dirs\r\n['/opt/rh/python27/root/usr/lib', '/lib64', '/usr/lib64', '/usr/local/lib', '/usr/lib', '/opt/rh/python27/root/usr/lib64']\r\n```"}}