Comments (8)
Hmm, perhaps this command will give us a better answer. python -m octave_kernel.check
. oct2py
uses the octave_kernel
to interact with Octave.
from oct2py.
Hi @HamidKarimi-Rouzbahani, what is the error that is printed? It his coming from this line.
from oct2py.
Hi @blink1073,
Thanks for getting back to me.
The error is as above:
ImportError: cannot import name 'octave' from 'oct2py' (C:\Users\99021\Anaconda3\envs\pyspi\lib\site-packages\oct2py\ init.py)
Please note that it drops the double underlines before and after init when I paste the error here.
I am not sure which line of init it comes from. Sorry, I am not super familiar with Python.
Is there any more information that can help you?
I am trying to use the pyspi toolbox, which seems to use some matlab codes and therefore needs octave. So, it calls oct2py to load octave but seems to fail. I have installed GNU octave from here: https://octave.org/download
Thanks
from oct2py.
Command Prompt returns this error:
C:\Program Files\Python\Python39\python.exe: Error while finding module specification for 'octave_kernel.check.' (ModuleNotFoundError: No module named 'octave_kernel')
Would it be possible to drop a few lines here about how to install octave and load it through oct2py in Spyder? Maybe if I understand how it is to be done, I can manage to fix the problem somehow.
from oct2py.
This looks like a multiple-pythons issue. I'd recommend asking for help from the spyder folks, I haven't used spyder in many years.
from oct2py.
Hmm, perhaps this command will give us a better answer.
python -m octave_kernel.check
.oct2py
uses theoctave_kernel
to interact with Octave.
I have the same problem when I import octave
root@62ec78395647:/home# python3 -m octave_kernel.check
Octave kernel v0.35.1
Metakernel v0.30.1
Python v3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
Python path: /usr/bin/python3
Connecting to Octave...
Octave connection established
Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f7bab7b8610>
command: /usr/bin/octave
args: [b'/usr/bin/octave', b'--interactive', b'--quiet', b'--no-init-file']
buffer (last 100 chars): ''
before (last 100 chars): ''
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 306
child_fd: 6
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile('octave.*>')
from oct2py.
Hmm, perhaps this command will give us a better answer.
python -m octave_kernel.check
.oct2py
uses theoctave_kernel
to interact with Octave.
And I ran this :
import oct2py
dir(oct2py)
['Cell', 'Oct2Py', 'Oct2PyError', 'Struct', 'StructArray', 'all', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'version', 'demo', 'get_log', 'kill_octave', 'speed_check', 'thread_check']
dir(oct2py.Oct2Py)
['class', 'del', 'delattr', 'dict', 'dir', 'doc', 'enter', 'eq', 'exit', 'format', 'ge', 'getattr', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', '_exist', '_feval', '_get_doc', '_get_function_ptr', '_get_max_nout', '_get_user_class', '_handle_stdin', '_isobject', '_parse_error', '_print_doc', 'eval', 'exit', 'extract_figures', 'feval', 'get_pointer', 'logger', 'pull', 'push', 'restart']
oc = Oct2Py()
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/oct2py/core.py", line 563, in restart
self._engine = OctaveEngine(stdin_handler=self._handle_stdin, logger=self.logger)
File "/usr/local/lib/python3.10/dist-packages/octave_kernel/kernel.py", line 185, in init
self.repl = self._create_repl()
File "/usr/local/lib/python3.10/dist-packages/octave_kernel/kernel.py", line 416, in _create_repl
repl = REPLWrapper(cmd, orig_prompt, change_prompt,
File "/usr/local/lib/python3.10/dist-packages/metakernel/replwrap.py", line 88, in init
self.set_prompt(prompt_regex,
File "/usr/local/lib/python3.10/dist-packages/metakernel/replwrap.py", line 112, in set_prompt
self.child.expect(prompt_regex)
File "/usr/local/lib/python3.10/dist-packages/pexpect/spawnbase.py", line 343, in expect
return self.expect_list(compiled_pattern_list,
File "/usr/local/lib/python3.10/dist-packages/pexpect/spawnbase.py", line 372, in expect_list
return exp.expect_loop(timeout)
File "/usr/local/lib/python3.10/dist-packages/pexpect/expect.py", line 181, in expect_loop
return self.timeout(e)
File "/usr/local/lib/python3.10/dist-packages/pexpect/expect.py", line 144, in timeout
raise exc
pexpect.exceptions.TIMEOUT: Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f42fc42dba0>
command: /usr/bin/octave
args: [b'/usr/bin/octave', b'--interactive', b'--quiet', b'--no-init-file']
buffer (last 100 chars): ''
before (last 100 chars): ''
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 398
child_fd: 9
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile('octave.*>')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.10/dist-packages/oct2py/core.py", line 87, in init
self.restart()
File "/usr/local/lib/python3.10/dist-packages/oct2py/core.py", line 565, in restart
raise Oct2PyError(str(e))
oct2py.utils.Oct2PyError: Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f42fc42dba0>
command: /usr/bin/octave
args: [b'/usr/bin/octave', b'--interactive', b'--quiet', b'--no-init-file']
buffer (last 100 chars): ''
before (last 100 chars): ''
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 398
child_fd: 9
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile('octave.*>')
from oct2py.
Related Issues (20)
- error: 'upfirdn' undefined near line 121, column 121 HOT 5
- Struct fieldnames that start with number are ignored HOT 1
- Bug: PULL-PUSH-PULL 1D Column vector will convert into 1D Row Vector HOT 4
- push will push Cell HOT 2
- [Question] Properly end session HOT 4
- Using `system ("cat ~/.octaverc")` on Winows HOT 2
- initialization: graphics_toolkit: 2004h toolkit is not available HOT 5
- Run doesn't create new variables in the octave environment HOT 3
- Conflict with opencv HOT 5
- bracketed paste \x1b[?2004h issue HOT 3
- Memory Leak HOT 1
- Problem with calling function; too many outputs HOT 1
- When I use python multiprocessing to open multiple octave displays a timeou HOT 1
- Problem with matlab package folders?
- Thread pool executor leaves ghost-threads that fill up memory
- Calling function script takes 1.5 seconds HOT 1
- error: 'graphics_toolkit' undefined
- _exist function not removing special characters from response HOT 2
- Error on testing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oct2py.