>> setenv("TEMP", "C:/temp")
>> setenv("TMP", "C:/temp")
>> pkg install -forge econometrics
cp: target '"C:/Users/Maintenant Pr'$'\303\252''t/AppData/Roaming/octave/api-v57/packages/econometrics-1.1.2"' is not a directory
ok, this verifies that the symbols in your username are preventing it from putting the package file in the 'local' location, even when you have a different temp folder specified for any package prep.
>> pkg install -forge -global econometrics-1.1.2.tar.gz
error: get_forge_pkg: package not found: "econometrics-1.1.2.tar.gz". Did you mean "econometrics"?
as it suggests, that shouldn't be expected to work. -forge tells it to go get the most recent version of a package using its name (econometrics). "econometrics-1.1.2.tar.gz" is just a filename that contains that package, but it is not a package name.
>> pkg install -forge -global econometrics
error: couldn't create installation directory C:\PROGRA~1\GNUOCT~3\mingw64\share\octave\packages\econometrics-1.1.2 : Permission denied
this would be expected to work. but it appears you don't have user write permission to the Program Files installation folder. I'm guessing you had to install using Administrative privilege escalation? ( a "do you give this program permission to make changes" message during installation) In that case you would have to "Run as Administrator" to be allowed to install packages to the -global location inside Program Folders.
- Dmitri procedure but with pkg install -forge -global econometrics
>> setenv("TEMP", "C:/temp")
>> setenv("TMP", "C:/temp")
>> pkg install -forge -global econometrics
error: couldn't create installation directory C:\PROGRA~1\GNUOCT~3\mingw64\share\octave\packages\econometrics-1.1.2 : Permission denied
error: called from
install>copy_files at line 522 column 7
install at line 237 column 7
pkg at line 612 column 9
same as above, and that's about all the information needed to know what's going on.
Summary - you can't use your user folder because of non-standard username characters for either temp space or package installation. you can't do package installation in the 'global' location as a user because of permission/security limitations.
My suggestions:
1 - make the tempdir changes 'permanent' by adding the lines
setenv("TEMP", "C:/temp")
setenv("TMP", "C:/temp")
to a file named .octaverc which will be run at startup. the locations where Octave checks for a .octaverc file is listed in the documentation here:
based on your permissions issues I'm not certain which of those would be best for you to use.
2 - stick with octave installed to Program Files, and only do package installation after starting octave with 'Run as Administrator". You _should_ be able to install packages using -global and either a local .tar.gz file or with the -forge <packagename> option.
3 - Use a different location to install Octave. C:\Octave is generally recommended for these cases. If you have issues doing this without administrative permissions, there are zip packages instead of the exe installers available, and you can follow the guidance here for manual installs:
https://wiki.octave.org/Octave_for_Microsoft_Windows that should allow you to use either -global package install method, assuming your system gives you user write access to the new install location.