oct2py

Problems importing the oct2py python package

江枫思渺然 提交于 2021-02-05 07:45:07
问题 I have installed the oct2py package using the pip command pip install oct2py , set the environement path of python, pip and octave as in the following picture: However, whenever I try to import it in my python script, I get the following error: I checked whether the package is installed, it says: Requirement satisfied . Any ideas of what I could possibly be doing wrong? 来源: https://stackoverflow.com/questions/65792257/problems-importing-the-oct2py-python-package

Installed the oct2py package but is not recognized when imported

杀马特。学长 韩版系。学妹 提交于 2021-01-28 11:25:08
问题 I have just installed the oct2py python package using the following command on my Windows: pip install oct2py However, whenever I try to import the package oct2py in my python script, I get the error: No module named "oct2py" What is it that is making me have this error? 回答1: Change your environment variable from 'C:\Program Files\Python39' to this one 'C:\Users\YOU\AppData\Local\Programs\Python\Python39'. 来源: https://stackoverflow.com/questions/65773291/installed-the-oct2py-package-but-is

oct2py isn't seeing OCTAVE_EXECUTABLE environment variable (Windows)

夙愿已清 提交于 2021-01-27 06:02:59
问题 So, I'm trying to use oct2py on Windows, like so: from oct2py import octave That's literally the only code I need to reproduce the error. When I execute this, I get OSError: Octave Executable not found, please add to path or set"OCTAVE_EXECUTABLE" environment variable . However, I have already set OCTAVE_EXECUTABLE as a system variable, which points to "C:\Octave\Octave-4.4.1\bin\octave-cli-4.4.1.exe" . Opening up the command line and running %OCTAVE_EXECUTABLE% gives me the Octave CLI, so I

Oct2Py only returning the first output argument

做~自己de王妃 提交于 2020-08-04 04:13:27
问题 I'm using Oct2Py in order to use some M-files in my Python code. Let's say that I have this simple Matlab function : function [a, b] = toto(c); a = c; b = c + 1; end What happens if I call it in Octave is obviously : >> [x,y] = toto(3) x = 3 y = 4 Now if I call it in Python, using oct2py : from oct2py import octave my_dir = "D:\\My_Dir" octave.addpath(my_dir) a,b = octave.toto(3) This returns : TypeError: 'int' object is not iterable It seems like octave.toto(n) only returns the first value,

get data from octave script execution using oct2py (python3)

孤者浪人 提交于 2019-12-24 07:35:04
问题 I'm trying to execute some Matlab scripts (not a function definition) from Python 3 using oct2py module. Those scripts (a large amount) contains a very extended definition to read a specific ASCIII files (contained in the same directory). I do not know how to get the data read by Python with the Matlab (octave) scripts. Here what I am doing: from oct2py import octave import numpy as np import os import pprint hom_dir='/path_to/files&scripts_dir/' os.chdir(hom_dir) octave.addpath(/path_to

Change dtype data_type fields of numpy array

六眼飞鱼酱① 提交于 2019-12-13 07:18:46
问题 I have a .mat file which I load using scipy : from oct2py import octave import scipy.io as spio matPath = "path/to/file.mat" matFile = spio.loadmat(matPath) I get a numpy array which I want to pass to octave function using oct2py , like that: aMatStruct = matFile["aMatStruct"] result = octave.aMatFunction(aMatStruct) But I get the following error: oct2py.utils.Oct2PyError: Datatype not supported It seems it's due to the array dtype , which looks like: [('x', 'O'), ('y', 'O'), ('z', 'O')] So I

oct2py in Anaconda/Spyder not recognizing octave

試著忘記壹切 提交于 2019-12-12 02:13:41
问题 Windows7 Anaconda/python ver 3.4 Octave ver 4.0.3 OCTAVE_EXECUTABLE = C:\Users\Heather\Octave-4.0.3\bin Hi all, I've been working a few days on trying to get oct2py working in Anaconda using Spyder. I was wondering if anyone could tell me the correct way to get it to work in Spyder on a windows machine? Basic setup maybe or maybe I'm using the wrong packages? So far I've installed the oct2py package per the Anaconda Cloud using: conda install -c conda-forge oct2py=3.5.9 In all the

Import oct2py says access is denied

亡梦爱人 提交于 2019-11-28 06:53:36
问题 I have installed Python anaconda environment, and installed oct2py using (D:\Anaconda2) C:\Users\BNP>conda install -c conda-forge oct2py When I try to import oct2py from anaconda prompt, it doesn't show any error Anaconda prompt: But when I try import oct2py from spder it says access is denied. 回答1: Have you tried to run the command as administrator? 来源: https://stackoverflow.com/questions/47770473/import-oct2py-says-access-is-denied