Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #51375 > unrolled thread
| Started by | syed khalid <syedk@pacificloud.com> |
|---|---|
| First post | 2013-07-27 16:15 -0700 |
| Last post | 2013-07-28 10:44 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.python
python import module question syed khalid <syedk@pacificloud.com> - 2013-07-27 16:15 -0700
Re: python import module question Chris Angelico <rosuav@gmail.com> - 2013-07-28 00:33 +0100
Re: python import module question Peter Otten <__peter__@web.de> - 2013-07-28 10:44 +0200
| From | syed khalid <syedk@pacificloud.com> |
|---|---|
| Date | 2013-07-27 16:15 -0700 |
| Subject | python import module question |
| Message-ID | <f477e6b7-164b-4363-a22a-dd99fa16ab46@googlegroups.com> |
I am trying to do a "import shogun" in my python script. I can invoke shogun with a command line with no problem. But I cannot with a python import statement. >>>>>invoking python from a command line........... Syedk@syedk-ThinkPad-T410:~/shogun-2.0.0/src/interfaces/cmdline_static$ shogun | more libshogun (i686/v2.0.0_9c8012f_2012-09-04_09:08_164102447) Copyright (C) 1999-2009 Fraunhofer Institute FIRST Copyright (C) 1999-2011 Max Planck Society Copyright (C) 2009-2011 Berlin Institute of Technology Copyright (C) 2012 Soeren Sonnenburg, Sergey Lisitsyn, Heiko Strathmann Written (W) 1999-2012 Soeren Sonnenburg, Gunnar Raetsch et al. ( configure options: "configure options --interfaces=python_static" compile flag s: "-fPIC -g -Wall -Wno-unused-parameter -Wformat -Wformat-security -Wparenthese s -Wshadow -Wno-deprecated -O9 -fexpensive-optimizations -frerun-cse-after-loop -fcse-follow-jumps -finline-functions -fschedule-insns2 -fthread-jumps -fforce-a ddr -fstrength-reduce -funroll-loops -march=native -mtune=native -pthread" link flags: " -Xlinker --no-undefined" ) ( seeding random number generator with 3656470784 (seed size 256)) determined range for x in log(1+exp(-x)) is:37 ) >>>Trying to call python from a script in the same directory where I invoked the shogun from a command linesyedk@syedk-ThinkPad-T410:~/shogun-2.0.0/src/interfaces/cmdline_static$ python Python 2.7.3 (default, Apr 10 2013, 05:46:21) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import shogun Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named shogun >>> Regards
[toc] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-07-28 00:33 +0100 |
| Message-ID | <mailman.5186.1374967991.3114.python-list@python.org> |
| In reply to | #51375 |
On Sun, Jul 28, 2013 at 12:15 AM, syed khalid <syedk@pacificloud.com> wrote: > Syedk@syedk-ThinkPad-T410:~/shogun-2.0.0/src/interfaces/cmdline_static$ shogun | more This implies that you have something called 'shogun', without an extension, in your $PATH. Where is the actual script? You may need to install it by a quite different method, to make it available in Python. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2013-07-28 10:44 +0200 |
| Message-ID | <mailman.5189.1375001043.3114.python-list@python.org> |
| In reply to | #51375 |
syed khalid wrote: > I am trying to do a "import shogun" in my python script. I can invoke > shogun with a command line with no problem. But I cannot with a python > import statement. > >>>>>>invoking python from a command line........... > > Syedk@syedk-ThinkPad-T410:~/shogun-2.0.0/src/interfaces/cmdline_static$ > shogun | more libshogun (i686/v2.0.0_9c8012f_2012-09-04_09:08_164102447) > > Copyright (C) 1999-2009 Fraunhofer Institute FIRST > Copyright (C) 1999-2011 Max Planck Society > Copyright (C) 2009-2011 Berlin Institute of Technology > Copyright (C) 2012 Soeren Sonnenburg, Sergey Lisitsyn, Heiko Strathmann > Written (W) 1999-2012 Soeren Sonnenburg, Gunnar Raetsch et al. > > ( configure options: "configure options --interfaces=python_static" > compile flag s: "-fPIC -g -Wall -Wno-unused-parameter -Wformat > -Wformat-security -Wparenthese s -Wshadow -Wno-deprecated -O9 > -fexpensive-optimizations -frerun-cse-after-loop -fcse-follow-jumps > -finline-functions -fschedule-insns2 -fthread-jumps -fforce-a ddr > -fstrength-reduce -funroll-loops -march=native -mtune=native -pthread" > link flags: " -Xlinker --no-undefined" ) ( seeding random number generator > with 3656470784 (seed size 256)) determined range for x in log(1+exp(-x)) > is:37 ) > >>>>Trying to call python from a script in the same directory where I >>>>invoked the shogun from a command >>>>linesyedk@syedk-ThinkPad- T410:~/shogun-2.0.0/src/interfaces/cmdline_static$ >>>>python > Python 2.7.3 (default, Apr 10 2013, 05:46:21) > [GCC 4.6.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import shogun > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: No module named shogun Poking around a bit on the project's website http://shogun-toolbox.org/doc/en/2.0.1/interfaces.html it looks like you are trying to use their "modular" interface when you have only installed the "static" one. I'm guessing that >>> import sg will work.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web