Octave Symbolic Error- "Error in var export" - octave

I am having a tough time with the symbolic package in octave.
Software Versions (downloaded everything today):
-Octave: 4.0.0
-OctSymPy 2.2.2
-Python: 3.4
-SymPy: 0.7.6
When I try to multiply/divide/raise to a power symbolic variables, I get the following error:
PYTHON: Error in var export
Resetting the octsympy communication mechanism
Closing the Python pipe...
error: python_cmd: unexpected return
error: called from
python_cmd at line 143 column 6
mtimes at line 42 column 5
syms X Y
X*Y
I am totally stumped. Does anyone have any ideas on the cause of this? I can add and differientiate symbolic expressions, so it is working to some extent.
Thanks!

I had the same problem and I just have downloaded and installed the python version 2.7.11 and worked fine.
Ah, don't forget to reinstall SimPy, but this time on the new Python version.
When you get back to octave, it'll recognize that version.

Related

Error when installing package in Octave-online

I want to install the image package in Octave-online.net, but when I tried it, it gave me an error message. I am on a MacBook Air 2013 (if that's important), on macOS 11.7.2 .
I have tried to install Octave on my laptop and that didn't work, so I'm trying it with the online version.
I wrote
pkg install -forge image
and expected it to install the package, but instead it gave me the following error message:
error: get_forge_pkg: could not read version number from package's page
error: called from
get_forge_pkg at line 55 column 7
get_forge_download at line 32 column 14
pkg at line 538 column 31
Does somebody know how to fix this or another way to install the package?
Thanks so much!

unable to install any pkg in Octave

I am new to Octave, coming from Matlab. I am trying to install a few packages, and so far none has worked. I have tried the download method from forge, then running the install command. But my question is about my latest attempt. There it is:
pkg install -global -forge io
csvconcat.cc:79:37: warning: result of comparison of constant 18446744073709551615 with expression of type
'unsigned int' is always true [-Wtautological-constant-out-of-range-compare]
while ((pos=str.find(prot, pos)) != str.npos) {
~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~
1 warning generated.
error: couldn't append to /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages
save: unable to open output file '/Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages'
error: called from
install at line 254 column 7
pkg at line 437 column 9
Couldn't find any documentation on it, I am a bit lost.... (oh and btw, I can't find the config.log file! where is that gem?)
I am on MacOS catalina 10.15.7, and just followed that procedure https://flaviocopes.com/fix-xcrun-error-invalid-active-developer-path/, which solved the issues I had before which is described on that page.
cheers for any help
The error:
error: couldn't append to /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages
save: unable to open output file '/Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages'
error: called from
install at line 254 column 7
pkg at line 437 column 9
basically says it's failing to save to that file. Probably a permissions issue. Check if the file /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages exists and its permissions. That file is a database of all packages installed globally, i.e., for all users in the system.
Fixing the permission issues is dependent on what is the permissions issue you have (probably you need to run octave as root to install a global package). But maybe try to install the package for your user only, i.e., install the package without the -global flag, like so:
pkg install -forge io

Broken pipe issue

I'm trying to learn machine learning using Octave.
OS: Mac, High Sierra 10.13.3
GNU Octave version: 3.8.0
t = [0: 0.01: 0.98];
y1 = sin(2*pi*4*t);
y2 = sin(2*pi*4*t);
plot(t, y1);
hold on;
plot(t, y2, 'r');
figure(1); plot(t,y1);
The first time I tried ran the last line I got: "Qt terminal communication error: select() error 9 Bad file descriptor"
After this I got a broken pipe error, I thought I need to plot both the graphs again before trying "figure(1); plot(y,t1);". But, it didn't work.
Checked whois and printed the values of y1, y2 and t; they do exist. So, my questions are:
Why am I not able to plot the graphs?
How do I solve broken pipe error?
How to solve the Qt terminal communication error?
Coursera's Machine Learning class is still using this version of Octave (3.8.0)
Here is what helped me:
run the following the os x terminal:
brew uninstall gnuplot
brew install gnuplot --with-qt
then create a file in your home directory called .octaverc and add the following to it:
setenv("GNUTERM","qt")
Relaunch octave-cli
Good Luck!
simply close the terminal and relaunch it , and this fixes the issue.
This occurred to me as I tried quitting the gnu-plot instead of using close command causing the pipe linked to gnu be broken.

error installing octcdf-1.1.5

I Have in my Mac:
Octave-3.4.0
Gnuplot 4.2 - that I had to install because I had problems plotting - it wouldn't plot at all.
I need to load a netcdf file, the error that came was:
nc = netcdf('/users/matheuscortezi/Desktop/Pcse005/ocean_avg.nc', 'r')
error: `netcdf' undefined near line 9 column 6
So I think I don't have the netcdf comand installed, and tried installing by typing this on octave:
pkg install -global -forge octcdf
The error message that I receive from that is:
configure: error: in `/var/tmp/oct-t8XcYD/octcdf/src':
configure: error: C compiler cannot create executables
See `config.log' for more details.
the configure script returned the following error: checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no
error: called from `pkg>configure_make' in file /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/pkg/pkg.m near line 1325, column 9
error: called from:
error: /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/pkg/pkg.m at line 783, column 5
error: /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/pkg/pkg.m at line 354, column 9
I haven't the faintest idea about what I should do. How can I solve this problem with either:
fixing this error, or
installing a netcdf "comand pack" (i don't know the name for that) so I can use netcdf() as in the example given.
Hope I was clear enough.
It seems to me that you installed Octave from the Mac OSX App bundle. That is not recommended at all. You should install from one of the package managers as explained on Octave's wiki. As far as I know, there are 3 options for Mac (see previous link). Just search for one that also has the netcdf package.
Anyway, if you really don't want to install it through a package manager (but seems to me you really should), seems that your problem lies on gcc (the GNU C compiler). do you have it installed at all? Some packages have code in C++ or C and are also dependent on some external libraries.
EDIT using a package manager would have also solved your problem about plotting since it would install gnuplot at same time

MySQL and MATLAB 64 bit

I'm trying to connect to MySQL using MATLAB R2009b 64 bit and the mysql.cpp file found on the FEX and here. I followed all the steps to compile listed in the second link. After entering the following:
mex -I"C:\mysql\include" -DWIN32 mysql.cpp "C:\mysql\lib\opt\libmySQL.lib"
the mysql.mexw64 file is created in my working directory. However, when I go to test it, I get the following error:
>> mysql('status')
??? Invalid MEX-file 'C:\[path]\mysql.mexw64': C:\[path]\mysql.mexw64 is not a valid Win32 application.
I tried switching out the -DWIN32 with -DWIN64, but that just threw all sorts of errors. Anyone have a suggestion as to why this isn't working?
I'm using MATLAB R2009b 64 bit on Windows 7 64 bit.
libmysql.dll is a 32-bit library. Matlab 64-bit wants mex-files to be compiled in 64-bit mode. Unless you can recompile the library, you won't be able to get the mex-file to work, I'm afraid.