running .py files on Linux
Dear Officer, I want to run two .py files to generate .h5 files. hantingt...@tityro:~$ python2.5 Python 2.5.4 (r254:67916, Jan 20 2010, 21:43:02) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. When ruuning gentest_sphere.py, the problem is as following: hantingt...@tityro:~/Downloads/triMC3D/python$ python2.5 gentest_sphere.py gsphere.h5 Usage: gentest_sphere.pynEl Testfile.h5 options: n: number of elements hantingt...@tityro:~/Downloads/triMC3D/python$ I guess I should write the command in the format of usage, but I don't know how to do it. When ruuning test_detector.py, the problem is as following: hantingt...@tityro:~/Downloads/triMC3D/python$ python2.5 test_detector.py tdetector.h5 h5/Opaque_material/ext_Trabecular_Bone-int_Cartilage/Nonenm/SourceNone/ lamb = None Traceback (most recent call last): File test_detector.py, line 600, in module main() File test_detector.py, line 567, in main hdf5.subs_lamb( materials, lamb ) File /home/hantingting/Downloads/triMC3D/python/local_modules/hdf5.py, line 703, in subs_lamb m.mu_s = m.mu_s(l) File /home/hantingting/Downloads/triMC3D/python/local_modules/matslib.py, line 71, in lambda [1550.0,1460.0,1360.0,1300.0,1240.0,1220.0,1220.0,1200.0,1160.0], s=300 )) File /usr/lib/python2.5/site-packages/scipy/interpolate/fitpack.py, line 485, in splev y,ier=_fitpack._spl_(x,der,t,c,k) TypeError: array cannot be safely cast to required type hantingt...@tityro:~/Downloads/triMC3D/python$ python2.5 test_detector.py usage: test_detector.py outputfile.h5 [options] options: -c Cage Material -e External Material -i Internal Material -l Lambda -o Output String -s Source Number -h Shows this help hantingt...@tityro:~/Downloads/triMC3D/python$ Could you please give me some advice to solve these two problems? I sincerely apologize that I am new for python. -- Best regards, HAN Tingting -- http://mail.python.org/mailman/listinfo/python-list
Re: running .py files on Linux
Tingting HAN írta: Dear Officer, I want to run two .py files to generate .h5 files. hantingt...@tityro:~$ mailto:hantingt...@tityro:%7E$ python2.5 Python 2.5.4 (r254:67916, Jan 20 2010, 21:43:02) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. When ruuning gentest_sphere.py, the problem is as following: hantingt...@tityro:~/Downloads/triMC3D/python$ mailto:hantingt...@tityro:%7E/Downloads/triMC3D/python$ python2.5 gentest_sphere.py gsphere.h5 Usage: gentest_sphere.pynEl Testfile.h5 options: n: number of elements hantingt...@tityro:~/Downloads/triMC3D/python$ mailto:hantingt...@tityro:%7E/Downloads/triMC3D/python$ I guess I should write the command in the format of usage, but I don't know how to do it. When ruuning test_detector.py, the problem is as following: hantingt...@tityro:~/Downloads/triMC3D/python$ mailto:hantingt...@tityro:%7E/Downloads/triMC3D/python$ python2.5 test_detector.py tdetector.h5 h5/Opaque_material/ext_Trabecular_Bone-int_Cartilage/Nonenm/SourceNone/ lamb = None Traceback (most recent call last): File test_detector.py, line 600, in module main() File test_detector.py, line 567, in main hdf5.subs_lamb( materials, lamb ) File /home/hantingting/Downloads/triMC3D/python/local_modules/hdf5.py, line 703, in subs_lamb m.mu_s = m.mu_s(l) File /home/hantingting/Downloads/triMC3D/python/local_modules/matslib.py, line 71, in lambda [1550.0,1460.0,1360.0,1300.0,1240.0,1220.0,1220.0,1200.0,1160.0], s=300 )) File /usr/lib/python2.5/site-packages/scipy/interpolate/fitpack.py, line 485, in splev y,ier=_fitpack._spl_(x,der,t,c,k) TypeError: array cannot be safely cast to required type hantingt...@tityro:~/Downloads/triMC3D/python$ mailto:hantingt...@tityro:%7E/Downloads/triMC3D/python$ python2.5 test_detector.py usage: test_detector.py outputfile.h5 [options] options: -c Cage Material -e External Material -i Internal Material -l Lambda -o Output String -s Source Number -h Shows this help hantingt...@tityro:~/Downloads/triMC3D/python$ mailto:hantingt...@tityro:%7E/Downloads/triMC3D/python$ Could you please give me some advice to solve these two problems? I sincerely apologize that I am new for python. Did you try this: 1.) replace the first line of gentest_sphere.py to #!/usr/bin/python2.5 (or your path to python2.5) 2.) chmod +x gentest_sphere.py 3.) run this: ./gentest_sphere.py gsphere.h5 (instead of python2.5 ./gentest_sphere.py gsphere.h5 It may not help. But... suspicious. You used the advertised command line. The program may have a bug. E.g. it uses sys.argv the incorrect way. Best, Laszlo -- http://mail.python.org/mailman/listinfo/python-list
Re: running .py files on Linux
2010/4/27 Tingting HAN hihigh...@gmail.com I did as you say: hantingt...@tityro:~/Downloads$ ls hdfview_install_linux32.bin PythonPyTables triMC3D triMC3D_v1.0.0.tar.gz hantingt...@tityro:~/Downloads$ md5sum triMC3D_v1.0.0.tar.gz triMC3D.md5 hantingt...@tityro:~/Downloads$ ls hdfview_install_linux32.bin triMC3D triMC3D_v1.0.0.tar.gz PythonPyTables triMC3D.md5 hantingt...@tityro:~/Downloads$ md5sum -c triMC3D.md5 triMC3D_v1.0.0.tar.gz: OK hantingt...@tityro:~/Downloads$ tar zxvf triMC3D_v1.0.0.tar.gz So as it shows OK, the package is not corrupt. I extracted it and ran the .py files again, but there is still the same error as before: hantingt...@tityro:~/Downloads/triMC3D-1.0.0/python$ python gentest_empty.py Traceback (most recent call last): File gentest_empty.py, line 8, in module from tables import * File /usr/lib/python2.6/dist-packages/tables/__init__.py, line 76, in module from tables.file import File, openFile, copyFile File /usr/lib/python2.6/dist-packages/tables/file.py, line 44, in module from tables import hdf5Extension File hdf5Extension.pyx, line 11, in hdf5Extension ImportError: No module named utilsExtension I attach two .py files from the downloaded package in this email. Could you please try running them and see what is the problem? 2010/4/26 alex goretoy agore...@gmail.com make sure the tar, zip or package you downloaded isn't corrupt. verify it with a md5sum and then extract it. just a thought. Thank you, -Alex Goretoy http://launchpad.net/~a1g On Mon, Apr 26, 2010 at 11:05 AM, Tingting HAN hihigh...@gmail.comwrote: Dear Officer, I downloaded a C code packet which contains many .py files. When I try to run these.py files on my computer with Linux system, for every .py file the following error occurs: hantingt...@tityro:~/Downloads/triMC3D/python$ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. [4]+ Stopped python hantingt...@tityro:~/Downloads/triMC3D/python$ python test_detector.py Traceback (most recent call last): File test_detector.py, line 9, in module from tables import * File /usr/lib/python2.6/dist-packages/tables/__init__.py, line 76, in module from tables.file import File, openFile, copyFile File /usr/lib/python2.6/dist-packages/tables/file.py, line 44, in module from tables import hdf5Extension File hdf5Extension.pyx, line 11, in hdf5Extension ImportError: No module named utilsExtension I downloaded the . I sincerely hope you could give me some advice to solve the problem. -- Best regards, HAN Tingting ETSI de Telecomunicación - office C-203-1 Dpto. Ingeniería Electrónica Ciudad Universitaria s/n Madrid 28040, Spain TEL: +34 65 232 4340 -- http://mail.python.org/mailman/listinfo/python-list -- Best regards, HAN Tingting ETSI de Telecomunicación - office C-203-1 Dpto. Ingeniería Electrónica Ciudad Universitaria s/n Madrid 28040, Spain TEL: +34 65 232 4340 Department of Photoelectric Information Engineering Zhejiang University Hangzhou 310027, P. R.China -- Best regards, HAN Tingting ETSI de Telecomunicación - office C-203-1 Dpto. Ingeniería Electrónica Ciudad Universitaria s/n Madrid 28040, Spain TEL: +34 65 232 4340 Department of Photoelectric Information Engineering Zhejiang University Hangzhou 310027, P. R.China configuration.py Description: Binary data gentest_empty.py Description: Binary data -- http://mail.python.org/mailman/listinfo/python-list
Re: running .py files on Linux
On Tue, Apr 27, 2010 at 3:54 AM, Tingting HAN hihigh...@gmail.com wrote: snip gentest_empty.py Traceback (most recent call last): File gentest_empty.py, line 8, in module from tables import * File /usr/lib/python2.6/dist-packages/tables/__init__.py, line 76, in module from tables.file import File, openFile, copyFile File /usr/lib/python2.6/dist-packages/tables/file.py, line 44, in module from tables import hdf5Extension File hdf5Extension.pyx, line 11, in hdf5Extension ImportError: No module named utilsExtension I attach two .py files from the downloaded package in this email. Could you please try running them and see what is the problem? Seems like your version of PyTables may be outdated. Your error looks similar to that described in this (fixed) bug: http://www.pytables.org/trac/ticket/183 What version of PyTables do you have installed? Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list
Re: running .py files on Linux
I apologize that I am new to Linux. I find this in my computer: /usr/lib/python2.6/dist-packages/tables$ How should I know which version of PyTables has been installed? What is the command? Which version should I download to solve the problem? And could you please give me the website link to download it because I am afraid I can not find the right place exactly. 2010/4/27 Chris Rebert c...@rebertia.com On Tue, Apr 27, 2010 at 3:54 AM, Tingting HAN hihigh...@gmail.com wrote: snip gentest_empty.py Traceback (most recent call last): File gentest_empty.py, line 8, in module from tables import * File /usr/lib/python2.6/dist-packages/tables/__init__.py, line 76, in module from tables.file import File, openFile, copyFile File /usr/lib/python2.6/dist-packages/tables/file.py, line 44, in module from tables import hdf5Extension File hdf5Extension.pyx, line 11, in hdf5Extension ImportError: No module named utilsExtension I attach two .py files from the downloaded package in this email. Could you please try running them and see what is the problem? Seems like your version of PyTables may be outdated. Your error looks similar to that described in this (fixed) bug: http://www.pytables.org/trac/ticket/183 What version of PyTables do you have installed? Cheers, Chris -- http://blog.rebertia.com -- Best regards, HAN Tingting ETSI de Telecomunicación - office C-203-1 Dpto. Ingeniería Electrónica Ciudad Universitaria s/n Madrid 28040, Spain TEL: +34 65 232 4340 Department of Photoelectric Information Engineering Zhejiang University Hangzhou 310027, P. R.China -- http://mail.python.org/mailman/listinfo/python-list
Re: running .py files on Linux
2010/4/27 Chris Rebert c...@rebertia.com On Tue, Apr 27, 2010 at 3:54 AM, Tingting HAN hihigh...@gmail.com wrote: snip gentest_empty.py Traceback (most recent call last): File gentest_empty.py, line 8, in module from tables import * File /usr/lib/python2.6/dist-packages/tables/__init__.py, line 76, in module from tables.file import File, openFile, copyFile File /usr/lib/python2.6/dist-packages/tables/file.py, line 44, in module from tables import hdf5Extension File hdf5Extension.pyx, line 11, in hdf5Extension ImportError: No module named utilsExtension I attach two .py files from the downloaded package in this email. Could you please try running them and see what is the problem? Seems like your version of PyTables may be outdated. Your error looks similar to that described in this (fixed) bug: http://www.pytables.org/trac/ticket/183 What version of PyTables do you have installed? On Tue, Apr 27, 2010 at 5:06 AM, Tingting HAN hihigh...@gmail.com wrote: I apologize that I am new to Linux. I find this in my computer: /usr/lib/python2.6/dist-packages/tables$ How should I know which version of PyTables has been installed? What is the command? Well, there are more generic ways depending on how you installed it, but for this particular package: python -c 'from tables.table import obversion; print obversion' Which version should I download to solve the problem? Dunno exactly, but based on the dates, it was fixed before 2.1.2 And could you please give me the website link to download it because I am afraid I can not find the right place exactly. Might as well just go for the latest version: http://www.pytables.org/download/preliminary/pytables-2.2b3/tables-2.2b3.tar.gz Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list
Re: running .py files on Linux
Well, another person in our lab solved it by using the command: python2.5 configuration.py I do not know exactly why python2.6 in my computer does not work. The code packet I dowloaded was was made in 2007, so maybe old versions of python should work. 2010/4/27 Chris Rebert creb...@ucsd.edu 2010/4/27 Chris Rebert c...@rebertia.com On Tue, Apr 27, 2010 at 3:54 AM, Tingting HAN hihigh...@gmail.com wrote: snip gentest_empty.py Traceback (most recent call last): File gentest_empty.py, line 8, in module from tables import * File /usr/lib/python2.6/dist-packages/tables/__init__.py, line 76, in module from tables.file import File, openFile, copyFile File /usr/lib/python2.6/dist-packages/tables/file.py, line 44, in module from tables import hdf5Extension File hdf5Extension.pyx, line 11, in hdf5Extension ImportError: No module named utilsExtension I attach two .py files from the downloaded package in this email. Could you please try running them and see what is the problem? Seems like your version of PyTables may be outdated. Your error looks similar to that described in this (fixed) bug: http://www.pytables.org/trac/ticket/183 What version of PyTables do you have installed? On Tue, Apr 27, 2010 at 5:06 AM, Tingting HAN hihigh...@gmail.com wrote: I apologize that I am new to Linux. I find this in my computer: /usr/lib/python2.6/dist-packages/tables$ How should I know which version of PyTables has been installed? What is the command? Well, there are more generic ways depending on how you installed it, but for this particular package: python -c 'from tables.table import obversion; print obversion' Which version should I download to solve the problem? Dunno exactly, but based on the dates, it was fixed before 2.1.2 And could you please give me the website link to download it because I am afraid I can not find the right place exactly. Might as well just go for the latest version: http://www.pytables.org/download/preliminary/pytables-2.2b3/tables-2.2b3.tar.gz Cheers, Chris -- http://blog.rebertia.com -- Best regards, HAN Tingting ETSI de Telecomunicación - office C-203-1 Dpto. Ingeniería Electrónica Ciudad Universitaria s/n Madrid 28040, Spain TEL: +34 65 232 4340 Department of Photoelectric Information Engineering Zhejiang University Hangzhou 310027, P. R.China -- http://mail.python.org/mailman/listinfo/python-list
Re: running .py files on Linux
2010/4/27 Chris Rebert creb...@ucsd.edu 2010/4/27 Chris Rebert c...@rebertia.com On Tue, Apr 27, 2010 at 3:54 AM, Tingting HAN hihigh...@gmail.com wrote: snip gentest_empty.py Traceback (most recent call last): File gentest_empty.py, line 8, in module from tables import * File /usr/lib/python2.6/dist-packages/tables/__init__.py, line 76, in module from tables.file import File, openFile, copyFile File /usr/lib/python2.6/dist-packages/tables/file.py, line 44, in module from tables import hdf5Extension File hdf5Extension.pyx, line 11, in hdf5Extension ImportError: No module named utilsExtension I attach two .py files from the downloaded package in this email. Could you please try running them and see what is the problem? Seems like your version of PyTables may be outdated. Your error looks similar to that described in this (fixed) bug: http://www.pytables.org/trac/ticket/183 What version of PyTables do you have installed? On Tue, Apr 27, 2010 at 5:06 AM, Tingting HAN hihigh...@gmail.com wrote: I apologize that I am new to Linux. I find this in my computer: /usr/lib/python2.6/dist-packages/tables$ How should I know which version of PyTables has been installed? What is the command? Well, there are more generic ways depending on how you installed it, but for this particular package: python -c 'from tables.table import obversion; print obversion' Which version should I download to solve the problem? Dunno exactly, but based on the dates, it was fixed before 2.1.2 And could you please give me the website link to download it because I am afraid I can not find the right place exactly. Might as well just go for the latest version: http://www.pytables.org/download/preliminary/pytables-2.2b3/tables-2.2b3.tar.gz On Tue, Apr 27, 2010 at 8:12 AM, Tingting HAN hihigh...@gmail.com wrote: Well, another person in our lab solved it by using the command: python2.5 configuration.py I do not know exactly why python2.6 in my computer does not work. The code packet I dowloaded was was made in 2007, so maybe old versions of python should work. That's unsurprising. As stated in the bug, the problem is related to a language change that happened in Python 2.6; obviously using an older version of Python would fix that, although you're stuck without the other niceties of v2.6 over v2.5, and without whatever bug fixes have been applied to PyTables since the version you're using. At any rate, glad you got it working. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list
running .py files on Linux
Dear Officer, I downloaded a C code packet which contains many .py files. When I try to run these.py files on my computer with Linux system, for every .py file the following error occurs: hantingt...@tityro:~/Downloads/triMC3D/python$ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. [4]+ Stopped python hantingt...@tityro:~/Downloads/triMC3D/python$ python test_detector.py Traceback (most recent call last): File test_detector.py, line 9, in module from tables import * File /usr/lib/python2.6/dist-packages/tables/__init__.py, line 76, in module from tables.file import File, openFile, copyFile File /usr/lib/python2.6/dist-packages/tables/file.py, line 44, in module from tables import hdf5Extension File hdf5Extension.pyx, line 11, in hdf5Extension ImportError: No module named utilsExtension I downloaded the . I sincerely hope you could give me some advice to solve the problem. -- Best regards, HAN Tingting ETSI de Telecomunicación - office C-203-1 Dpto. Ingeniería Electrónica Ciudad Universitaria s/n Madrid 28040, Spain TEL: +34 65 232 4340 -- http://mail.python.org/mailman/listinfo/python-list
Re: running .py files on Linux
make sure the tar, zip or package you downloaded isn't corrupt. verify it with a md5sum and then extract it. just a thought. Thank you, -Alex Goretoy http://launchpad.net/~a1g On Mon, Apr 26, 2010 at 11:05 AM, Tingting HAN hihigh...@gmail.com wrote: Dear Officer, I downloaded a C code packet which contains many .py files. When I try to run these.py files on my computer with Linux system, for every .py file the following error occurs: hantingt...@tityro:~/Downloads/triMC3D/python$ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. [4]+ Stopped python hantingt...@tityro:~/Downloads/triMC3D/python$ python test_detector.py Traceback (most recent call last): File test_detector.py, line 9, in module from tables import * File /usr/lib/python2.6/dist-packages/tables/__init__.py, line 76, in module from tables.file import File, openFile, copyFile File /usr/lib/python2.6/dist-packages/tables/file.py, line 44, in module from tables import hdf5Extension File hdf5Extension.pyx, line 11, in hdf5Extension ImportError: No module named utilsExtension I downloaded the . I sincerely hope you could give me some advice to solve the problem. -- Best regards, HAN Tingting ETSI de Telecomunicación - office C-203-1 Dpto. Ingeniería Electrónica Ciudad Universitaria s/n Madrid 28040, Spain TEL: +34 65 232 4340 -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list