[pypy-dev] newbie needs pypy setup help

Tom Roche Tom_Roche at pobox.com
Sun Jul 31 03:58:36 CEST 2011


Dan Stromberg Sat, 30 Jul 2011 16:15:08 -0700
> There might be a silly permission issue

Or more than one. I noticed

me at it:~$ pushd ${TARGET_DIR_ROOT} # i.e. where I'm copying pypy to, in /opt
me at it:/opt/pypy-c-jit-1.5.0-alpha0$ ls -alh
> total 440K
> drwxr-xr-x 8 root root 4.0K 2011-07-30 17:00 .
> drwxr-xr-x 8 root root 4.0K 2011-07-30 16:06 ..
> drwxr-xr-x 2 root root 4.0K 2011-07-30 16:45 bin
> drwxr-xr-x 2 root root 4.0K 2011-07-30 17:00 build
> drwx------ 2 root root 4.0K 2011-07-30 16:06 include
> drwx------ 7 root root 4.0K 2011-07-30 16:44 lib_pypy
> drwx------ 4 root root 4.0K 2011-07-30 16:06 lib-python
> -rw------- 1 root root 5.8K 2011-07-30 16:06 LICENSE
> -rw-r--r-- 1 root root  748 2011-07-30 16:06 README
> drwx------ 5 root root 4.0K 2011-07-30 16:45 site-packages

which seems wrong (even to me :-) So I whacked that install (below) and
rebuilt with the following: please note

* the chmod's

* again, that I'm using the "Linux binary (64bit)" tarball (as previously)

URI="https://bitbucket.org/pypy/pypy/downloads/pypy-1.5-linux64.tar.bz2"
TMP_DIR_ROOT="/tmp/pypy/pypy-c-jit-43780-b590cf6de419-linux64"
TARGET_DIR_ROOT="/opt/pypy-c-jit-1.5.0-alpha0"
TARGET_PYPY_EXEC="${TARGET_DIR_ROOT}/bin/pypy"
USR_PYPY_EXEC="/usr/local/bin/pypy"
for CMD in \
  "rm -fr $(dirname ${TMP_DIR_ROOT})" \
  "mkdir -p ${TMP_DIR_ROOT}" \
  "pushd $(dirname ${TMP_DIR_ROOT})" \
  "wget -O - ${URI} | tar xvjf -" \
  "ls -alh" \
  "popd" \
  "sudo rm -fr ${TARGET_DIR_ROOT}" \
  "sudo mkdir -p ${TARGET_DIR_ROOT}" \
  "sudo cp -r ${TMP_DIR_ROOT}/* ${TARGET_DIR_ROOT}/" \
  "sudo chmod a+rx ${TARGET_DIR_ROOT}/" \
  "pushd ${TARGET_DIR_ROOT}" \
  "find -maxdepth 1 -type f | xargs sudo chmod a+r" \
  "find -maxdepth 1 -type d | grep -ve '\.$' | xargs sudo chmod a+rx" \
  "sudo chmod a+rx ${TARGET_PYPY_EXEC}" \
  "sudo ls -al ${TARGET_PYPY_EXEC}" \
  "sudo ln -s ${TARGET_PYPY_EXEC} ${USR_PYPY_EXEC}" \
  "which pypy" \
  "sudo ls -al ${USR_PYPY_EXEC}" \
  "${USR_PYPY_EXEC} --version" \
  "sudo ls -al ${TARGET_DIR_ROOT}" \
  "pypy --version" \
  "pypy" \
  "pypy -c 'import sys; print sys.path'" \
  "popd" \
; do
  echo -e "$ ${CMD}"
  eval "${CMD}"
done

The tail of the resulting output is

> $ sudo ls -al /opt/pypy-c-jit-1.5.0-alpha0
> total 40
> drwxr-xr-x 7 root root 4096 2011-07-30 21:44 .
> drwxr-xr-x 8 root root 4096 2011-07-30 21:44 ..
> drwxr-xr-x 2 root root 4096 2011-07-30 21:44 bin
> drwxr-xr-x 2 root root 4096 2011-07-30 21:44 include
> drwxr-xr-x 7 root root 4096 2011-07-30 21:44 lib_pypy
> drwxr-xr-x 4 root root 4096 2011-07-30 21:44 lib-python
> -rw-r--r-- 1 root root 5921 2011-07-30 21:44 LICENSE
> -rw-r--r-- 1 root root  748 2011-07-30 21:44 README
> drwxr-xr-x 2 root root 4096 2011-07-30 21:44 site-packages

Those permissions look better than above/before, and

> $ pypy --version
> Python 2.7.1 (b590cf6de419, Apr 30 2011, 02:00:34)
> [PyPy 1.5.0-alpha0 with GCC 4.4.3]

still looks good, but

> $ pypy
> 'import site' failed
> Python 2.7.1 (b590cf6de419, Apr 30 2011, 02:00:34)
> [PyPy 1.5.0-alpha0 with GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> debug: OperationError:
> debug:  operror-type: ImportError
> debug:  operror-value: No module named _pypy_interact

is still hosed! though at least pypy is now finding its library path:

> $ pypy -c 'import sys; print sys.path'
> 'import site' failed
> ['', '/opt/pypy-c-jit-1.5.0-alpha0/lib_pypy', '/opt/pypy-c-jit-1.5.0-alpha0/lib-python/modified-2.7', '/opt/pypy-c-jit-1.5.0-alpha0/lib-python/2.7', '/opt/pypy-c-jit-1.5.0-alpha0/lib-python/modified-2.7/lib-tk', '/opt/pypy-c-jit-1.5.0-alpha0/lib-python/2.7/lib-tk', '/opt/pypy-c-jit-1.5.0-alpha0/lib-python/2.7/plat-linux2']

Which it wasn't before:

Tom Roche Sat, 30 Jul 2011 18:17:34 -0400
>> me at it:~$ pypy -c 'import sys; print sys.path'
>> > debug: WARNING: library path not found, using compiled-in sys.path and sys.prefix will be unset
>> > 'import site' failed
>> > ['', '/home/buildslave/bot64/pypy-c-jit-linux-x86-64/build/lib_pypy', '/home/buildslave/bot64/pypy-c-jit-linux-x86-64/build/lib-python/modified-2.7', '/home/buildslave/bot64/pypy-c-jit-linux-x86-64/build/lib-python/2.7', '/home/buildslave/bot64/pypy-c-jit-linux-x86-64/build/lib-python/modified-2.7/lib-tk', '/home/buildslave/bot64/pypy-c-jit-linux-x86-64/build/lib-python/2.7/lib-tk', '/home/buildslave/bot64/pypy-c-jit-linux-x86-64/build/lib-python/2.7/plat-linux2']

So I'm wondering, what else needs done in order to make this work? E.g.,
how to fix the "'import site' failed"?

TIA, Tom Roche <Tom_Roche at pobox.com>


More information about the pypy-dev mailing list