问题
The short story:
In the directory ...\octave-4.2.1\share\octave\packages
there were initially 45 package subdirectories (with .m
and other files), for instance financial-0.5.0
.
But I could not find a way to use them.
In more detail:
I have unzipped the portable (.zip) version of Octave 4.2.1 64 bit for Windows, at 8:00am (useful info for later), into C:\Users\user1\DOCUME~1\apps\OCTAVE~1.1
(originally C:\Users\user1\Documents\apps\octave-4.2.1
).
I have then installed symbolic-2.6.0
(at 8:19am) with
>> pkg install symbolic-2.6.0
and this one is now available, e.g.,
>> pkg list
Package Name | Version | Installation directory
--------------+---------+-----------------------
symbolic | 2.6.0 | C:\Users\user1\DOCUME~1\apps\OCTAVE~1.1\share\octave\packages\symbolic-2.6.0
As per official documentation,
>> pkg global_list
C:\Users\user1\DOCUME~1\apps\OCTAVE~1.1\share\octave\octave_packages
gives "the file in which to look for information on globally installed packages".
That file does not have any information on any of the 45 built-in packages. It only has info on symbolic
.
I guess this is already enough for the packages not to be available.
Moreover, the first line of the file states # Created by Octave 4.2.1, ... 08:19:23 2017 GMT <unknown@unknown>
, as if it did not exist prior to my installing symbolic
.
Questions:
Q1: Is there any way to make the packages available?
I guess I could install each of them, but I also guess that is not the way the .zip
provided is intended to be used.
Q2: Why would there be no octave_packages
provided?
PS: Inspired by this old link, I checked if there was an octave_packages
somewhere else in the tree... there is none.
PS2: Clarifications called for given a comment:
I did not do anything other than expanding the original zip file, and installing symbolic
. The answers are then implied, but I make them explicit anyway.
Where did you install the rest? I did not do it; they were built into the .zip
.
How did you try to install them? I did not.
Why are you not installing via forge? Because I already had the installer for symbolic downloaded.
Did you try setting a local_list in the same way as global_list (and as described in help pkg)? I did not set or try to set either local_list
or global_list
.
Have you tried creating an octave_packages file yourself? No. It was created automatically upon installing symbolic
.
Did you set a pkg prefix before installing? No.
回答1:
Do
pkg rebuild
From the documentation:
'rebuild' Rebuild the package database from the installed directories. This can be used in cases where the package database has been corrupted.
Once you do this, you should see all packages listed with the pkg list
command and you can load them as necessary.
Having said that, I would encourage you to report this as a bug to the octave bug tracker (if it's not there already), since, I agree, this is unlikely to be the desired first-run experience (it certainly isn't via the .exe
installer). Someone must have forgotten to include a valid, pre-generated octave_packages
file, which as you point out is missing from the zipfile.
回答2:
This is detailed in the Wiki:
If you instead installed Octave from the .zip archive, you need to first rebuild the package list on your local machine. (The command above will produce a blank output and packages will be inaccessible before rebuilding.) Do this by typing the following command:
pkg rebuild
It has been this way since v4.01 according to an earlier mailing list discussion. According to the person making the primary Windows build,
the installer execute "pkg rebuild" in the windows console. For zip version, you need execute by yourself.
So this is a known issue with the 'portable' windows version. I cannot comment on whether there's a particular reason (size?) not to have the pkg rebuild
done prior to zipping and releasing. There doesn't seem to be a good way to relay this issue/instruction to the user and it has created confusion before.
I could not find an associated bug, so one could be submitted to http://bugs.octave.org, it would at least formally track the issue even if there's no maintainer side interest in fixing it.
EDIT: there is now a bug related to this issue: Octave Bug #51632
来源:https://stackoverflow.com/questions/45399494/cannot-load-packages-available-in-share-octave-packages-but-not-listed-in-share