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

Compiled python modules are linking to ubuntu's python library instead of pyenv's python version #82

Closed
ckhoo opened this issue Nov 20, 2013 · 5 comments

Comments

@ckhoo
Copy link

ckhoo commented Nov 20, 2013

I am trying to "pyenv install 2.7.6" in ubuntu 12.04 (note this is a fresh ubuntu 12.04 install) and I am getting the following error.

ImportError: /opt/pyenv/versions/2.7.6/lib/python2.7/lib-dynload/_sqlite3.so: undefined symbol: _PyInt_AsInt

By doing "ldd _sqlite3.so" found in tmp build directory, I noticed the compiled sqlite3 module is linking to Ubuntu's default python2.7, which does not have _PyInt_AsInt symbol, since it is not python 2.7.6.

ldd /tmp/python-build.20131120202950.5916/Python-2.7.6/build/lib.linux-x86_64-2.7/_sqlite3.so
    linux-vdso.so.1 =>  (0x00007fff00dff000)
    libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f2da67bb000)
    libpython2.7.so.1.0 => /usr/lib/libpython2.7.so.1.0 (0x00007f2da62b8000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2da609a000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2da5cda000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2da5ad6000)
    libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f2da5877000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f2da549c000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2da5285000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f2da5081000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2da4d85000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2da4b6f000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f2da6c74000)

Is there some compilation flag I should set such that pyenv will compile sqlite3 module using the correct python library?

I am installing python 2.7.6 using the following:

export CONFIGURE_OPTS="--enable-shared --enable-unicode=ucs4";pyenv install 2.7.6

Thanks.

@yyuu
Copy link
Contributor

yyuu commented Nov 21, 2013

You might need to set LD_LIBRARY_PATH on GNU/Linux if you give --enable-shared as CONFIGURE_OPTS. See also #66.

@ckhoo
Copy link
Author

ckhoo commented Nov 25, 2013

Thanks Yuu. Your reference (#66) works for me.

@ckhoo
Copy link
Author

ckhoo commented Nov 26, 2013

Adding a note for anyone who wants to --enable-shared like myself,

  1. I had pyenv inside /opt/pyenv. Therefore, I setup my shared library path like this: export LD_LIBRARY_PATH=/opt/pyenv/versions/2.7.6/lib:$LD_LIBRARY_PATH

  2. be sure that LD_LIBRARY_PATH is a permanent entry in ~/.bashrc and not just during pyenv install 2.7.6.

@yyuu
Copy link
Contributor

yyuu commented Dec 20, 2013

I pushed 43212f6 which will set rpath if --enable-shared was given in PYTHON_CONFIGURE_OPTS. With this fix, just passing --enable-shared will resolve the issue.

$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.5

@yyuu yyuu closed this as completed Dec 20, 2013
@lambdalisue
Copy link

👍
this commit saved me a lot. thanks

yyuu pushed a commit to yyuu/homebrew that referenced this issue Jan 10, 2014
Changes:

* pyenv: Reliably detect parent shell in `pyenv init` (pyenv/pyenv#93)
* pyenv: Import recent changes from rbenv 0.4.0
* pyenv: Import `bats` tests from rbenv 0.4.0
* python-build: Add new CPython releases candidates; 3.4.0b2
* python-build: Add ruby-build style patching feature (pyenv/pyenv#91)
* python-build: Set `RPATH` if `--enable-shared` was given
  (pyenv/pyenv#65, pyenv/pyenv#66, pyenv/pyenv#82)
* python-build: Update default setuptools version (2.0 -> 2.1)
* python-build: Update default pip version (1.4.1 -> 1.5)
* python-build: Activate friendly CPython during build if the one is not
  activated
* python-build: Fix broken install.sh
* python-build: Import recent changes from ruby-build v20131225.1
* version-ext-compat: Removed from default plugin. Please use
  [pyenv-version-ext](https://github.com/yyuu/pyenv-version-ext)
  instead.
yyuu pushed a commit to yyuu/homebrew that referenced this issue Jan 10, 2014
Changes:

* pyenv: Reliably detect parent shell in `pyenv init` (pyenv/pyenv#93)
* pyenv: Import recent changes from rbenv 0.4.0
* pyenv: Import `bats` tests from rbenv 0.4.0
* python-build: Add new CPython releases candidates; 3.4.0b2
* python-build: Add ruby-build style patching feature (pyenv/pyenv#91)
* python-build: Set `RPATH` if `--enable-shared` was given
  (pyenv/pyenv#65, pyenv/pyenv#66, pyenv/pyenv#82)
* python-build: Update default setuptools version (2.0 -> 2.1)
* python-build: Update default pip version (1.4.1 -> 1.5)
* python-build: Activate friendly CPython during build if the one is not
  activated
* python-build: Fix broken install.sh
* python-build: Import recent changes from ruby-build v20131225.1
* python-build: Fix build error of CPython 2.x on the platform where the
  `gcc` is llvm-gcc.
* version-ext-compat: Removed from default plugin. Please use
  [pyenv-version-ext](https://github.com/yyuu/pyenv-version-ext)
  instead.
yyuu pushed a commit to yyuu/homebrew that referenced this issue Jan 10, 2014
Changes:

* pyenv: Reliably detect parent shell in `pyenv init` (pyenv/pyenv#93)
* pyenv: Import recent changes from rbenv 0.4.0
* pyenv: Import `bats` tests from rbenv 0.4.0
* python-build: Add new CPython releases candidates; 3.4.0b2
* python-build: Add ruby-build style patching feature (pyenv/pyenv#91)
* python-build: Set `RPATH` if `--enable-shared` was given
  (pyenv/pyenv#65, pyenv/pyenv#66, pyenv/pyenv#82)
* python-build: Update default setuptools version (2.0 -> 2.1)
* python-build: Update default pip version (1.4.1 -> 1.5)
* python-build: Activate friendly CPython during build if the one is not
  activated
* python-build: Fix broken install.sh
* python-build: Import recent changes from ruby-build v20131225.1
* python-build: Fix build error of CPython 2.x on the platform where the
  `gcc` is llvm-gcc.
* version-ext-compat: Removed from default plugin. Please use
  [pyenv-version-ext](https://github.com/yyuu/pyenv-version-ext)
  instead.
yyuu pushed a commit to yyuu/homebrew that referenced this issue Jan 10, 2014
Changes:

* pyenv: Reliably detect parent shell in `pyenv init` (pyenv/pyenv#93)
* pyenv: Import recent changes from rbenv 0.4.0
* pyenv: Import `bats` tests from rbenv 0.4.0
* python-build: Add new CPython releases candidates; 3.4.0b2
* python-build: Add ruby-build style patching feature (pyenv/pyenv#91)
* python-build: Set `RPATH` if `--enable-shared` was given
  (pyenv/pyenv#65, pyenv/pyenv#66, pyenv/pyenv#82)
* python-build: Update default setuptools version (2.0 -> 2.1)
* python-build: Update default pip version (1.4.1 -> 1.5)
* python-build: Activate friendly CPython during build if the one is not
  activated
* python-build: Fix broken install.sh
* python-build: Import recent changes from ruby-build v20131225.1
* python-build: Fix build error of CPython 2.x on the platform where the
  `gcc` is llvm-gcc.
* version-ext-compat: Removed from default plugin. Please use
  [pyenv-version-ext](https://github.com/yyuu/pyenv-version-ext)
  instead.
yyuu pushed a commit to yyuu/homebrew that referenced this issue Jan 23, 2014
Changes:

* pyenv: Reliably detect parent shell in `pyenv init` (pyenv/pyenv#93)
* pyenv: Import recent changes from rbenv 0.4.0
* pyenv: Import `bats` tests from rbenv 0.4.0
* python-build: Add new CPython releases candidates; 3.4.0b2
* python-build: Add ruby-build style patching feature (pyenv/pyenv#91)
* python-build: Set `RPATH` if `--enable-shared` was given
  (pyenv/pyenv#65, pyenv/pyenv#66, pyenv/pyenv#82)
* python-build: Update default setuptools version (2.0 -> 2.1)
* python-build: Update default pip version (1.4.1 -> 1.5)
* python-build: Activate friendly CPython during build if the one is not
  activated
* python-build: Fix broken install.sh
* python-build: Import recent changes from ruby-build v20131225.1
* python-build: Fix build error of CPython 2.x on the platform where the
  `gcc` is llvm-gcc.
* version-ext-compat: Removed from default plugin. Please use
  [pyenv-version-ext](https://github.com/yyuu/pyenv-version-ext)
  instead.
yyuu pushed a commit to yyuu/homebrew that referenced this issue Jan 23, 2014
Changes:

* pyenv: Reliably detect parent shell in `pyenv init` (pyenv/pyenv#93)
* pyenv: Import recent changes from rbenv 0.4.0
* pyenv: Import `bats` tests from rbenv 0.4.0
* python-build: Add new CPython releases candidates; 3.4.0b2
* python-build: Add ruby-build style patching feature (pyenv/pyenv#91)
* python-build: Set `RPATH` if `--enable-shared` was given
  (pyenv/pyenv#65, pyenv/pyenv#66, pyenv/pyenv#82)
* python-build: Update default setuptools version (2.0 -> 2.1)
* python-build: Update default pip version (1.4.1 -> 1.5)
* python-build: Activate friendly CPython during build if the one is not
  activated
* python-build: Fix broken install.sh
* python-build: Import recent changes from ruby-build v20131225.1
* python-build: Fix build error of CPython 2.x on the platform where the
  `gcc` is llvm-gcc.
* version-ext-compat: Removed from default plugin. Please use
  [pyenv-version-ext](https://github.com/yyuu/pyenv-version-ext)
  instead.
MikeMcQuaid pushed a commit to Homebrew/legacy-homebrew that referenced this issue Jan 24, 2014
Changes:

* pyenv: Reliably detect parent shell in `pyenv init` (pyenv/pyenv#93)
* pyenv: Import recent changes from rbenv 0.4.0
* pyenv: Import `bats` tests from rbenv 0.4.0
* python-build: Add new CPython releases candidates; 3.4.0b2
* python-build: Add ruby-build style patching feature (pyenv/pyenv#91)
* python-build: Set `RPATH` if `--enable-shared` was given
  (pyenv/pyenv#65, pyenv/pyenv#66, pyenv/pyenv#82)
* python-build: Update default setuptools version (2.0 -> 2.1)
* python-build: Update default pip version (1.4.1 -> 1.5)
* python-build: Activate friendly CPython during build if the one is not
  activated
* python-build: Fix broken install.sh
* python-build: Import recent changes from ruby-build v20131225.1
* python-build: Fix build error of CPython 2.x on the platform where the
  `gcc` is llvm-gcc.
* version-ext-compat: Removed from default plugin. Please use
  [pyenv-version-ext](https://github.com/yyuu/pyenv-version-ext)
  instead.

Closes #25783.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
ehershey pushed a commit to ehershey/homebrew that referenced this issue Apr 4, 2014
Changes:

* pyenv: Reliably detect parent shell in `pyenv init` (pyenv/pyenv#93)
* pyenv: Import recent changes from rbenv 0.4.0
* pyenv: Import `bats` tests from rbenv 0.4.0
* python-build: Add new CPython releases candidates; 3.4.0b2
* python-build: Add ruby-build style patching feature (pyenv/pyenv#91)
* python-build: Set `RPATH` if `--enable-shared` was given
  (pyenv/pyenv#65, pyenv/pyenv#66, pyenv/pyenv#82)
* python-build: Update default setuptools version (2.0 -> 2.1)
* python-build: Update default pip version (1.4.1 -> 1.5)
* python-build: Activate friendly CPython during build if the one is not
  activated
* python-build: Fix broken install.sh
* python-build: Import recent changes from ruby-build v20131225.1
* python-build: Fix build error of CPython 2.x on the platform where the
  `gcc` is llvm-gcc.
* version-ext-compat: Removed from default plugin. Please use
  [pyenv-version-ext](https://github.com/yyuu/pyenv-version-ext)
  instead.

Closes Homebrew#25783.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants