Re: Help running python tests on MIPS

2015-01-11 Thread rramesh1
On Sunday, January 11, 2015 at 1:45:33 AM UTC-8, Steven D'Aprano wrote:
> Ramesh wrote:
> 
> > I am new to python.
> > 
> > I downloaded python 2.7.8 tarball, successfully cross compiled it, to make
> > sure that the subsystems are correctly built, I tried running the python
> > test scripts on the MIPS based target board. I hit the below error while I
> > do so,
> 
> 
> On second thoughts, how are you doing this? If I'm reading the next line
> correctly:
> 
> > # /opt/Python-2.7.8/bin/python2.7
> > /opt/Python-2.7.8/lib/python2.7/test/test___all__.py
> 
> you haven't installed Python, you've just compiled it and are now trying to
> run the test suite manually.
> 
> If you read the README file, you should see instructions that tell you to
> run the following commands:
> 
> ./configure
> make
> make test
> sudo make install
> 
> 
> I recommend following those instructions if you can.
> 
> 
> -- 
> Steven

Thank you for the response.

I did see the README, here is what I am doing

configure
#Make hostpython & hostpgen
make python
make test
mv python hostpython 
mv Parser/hostpgen hostpgen
# Do a distclean before cross compiling
make distclean

# Configure with cross toolchain options
# gcc, g++, ar & ranlib for MIPS
# prefix pointing to /usr/lib on the target file system (MIPS)
configure 
#Build python for MIPS
make
make install

Actually I hit a problem in install (I got it worked around by doing -i (ignore 
errors), but later found the issue & fixed by a patch, after which - there were 
no errors in make install as well).

After the install, I am removing (rm -rf) certain files that I think are of no 
use as the target has limited flash space. 

==
   /bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/lib2to3
/bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/email
/bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/bsddb
/bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/xml
/bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/pydoc_data
/bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/lib-tk
/bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/sqlite3
/bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/idlelib
/bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/share
/bin/rm -rf 
${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/config/libpython2.7.a
/bin/rm -rf ${PYTHON_ROOTFS_DEPLOY_DIR}/lib/python2.7/test/audiodata

==

I set the PYTHONPATH point to /opt/Python-2.7.8/lib/python2.7

Still hit the same error. Am I missing something else?

 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help running python tests on MIPS

2015-01-11 Thread rramesh1
On Sunday, January 11, 2015 at 1:39:20 AM UTC-8, Steven D'Aprano wrote:
> Ramesh wrote:
> 
> > I am new to python.
> > 
> > I downloaded python 2.7.8 tarball, successfully cross compiled it, to make
> > sure that the subsystems are correctly built, I tried running the python
> > test scripts on the MIPS based target board. I hit the below error while I
> > do so,
> [...]
> > I tried setting PATH & PYTHONPATH, but it doesn't seem to fix the issue.
> 
> Tried setting them to what?
> 
> 
> > Can someone please advice on what possibly is causing this problem / how
> > to fix this?
> 
> Try running these commands from the operating system's shell, and report on
> the output:
> 
> 
> ls -ld /opt/Python-2.7.8/lib/python2.7/lib-dynload/
> 
> ls -l /opt/Python-2.7.8/lib/python2.7/lib-dynload/*coll*
> 
> python -c "import collections; print collections.__file__"
> 
> 
> 
> That will help diagnose the problem.
> 
> 
> 
> -- 
> Steven

For the above commands, here is the output 

# ls -ld /opt/Python-2.7.8/lib/python2.7/lib-dynload/ 
drwxr-xr-x2 root root  681 Jan 10  2015 
/opt/Python-2.7.8/lib/python2.7/lib-dynload/
# ls -l /opt/Python-2.7.8/lib/python2.7/lib-dynload/*coll*
ls: /opt/Python-2.7.8/lib/python2.7/lib-dynload/*coll*: No such file or 
directory
# /opt/Python-2.7.8/bin/python2.7 -c "import collections; print collections.__fi
le__" 
Traceback (most recent call last):
  File "", line 1, in 
  File "/opt/Python-2.7.8/lib/python2.7/collections.py", line 8, in 
from _collections import deque, defaultdict
ImportError: No module named _collections
# 

-- 
https://mail.python.org/mailman/listinfo/python-list