Выполнить гнуплот из cmd

7679
codeaviator

Мне нужно выполнить gnuplot из Windows cmd, однако при вводе gnuplotя получаю сообщение об ошибке:

«Gnuplot» не распознается как внутренняя или внешняя команда, работающая программа или командный файл.

Когда я установил программу, я помню, что использовал настройки по умолчанию, как показано на следующих скриншотах:

Выполнить гнуплот из cmd

Выполнить гнуплот из cmd

Я боюсь, что эти настройки теперь мешает мне от выполнения gnuplotиз cmd. Это правильно? Что я могу сделать, чтобы решить проблему?

1

3 ответа на вопрос

1
codeaviator

Действительно, во время установки я должен был проверить опцию « Добавить каталог приложения в переменную среды PATH ».

Я предпочел чистую установку вместо добавления PATHпеременной вручную. Поэтому я gnuplotполностью удалил и снова установил его, убедившись, что на этот раз я выбрал опцию. Все это заняло у меня менее 1 минуты.

Теперь я могу выполнить gnuplotиз cmdправильно.

0
duDE

You need to add your new program to the environment path like this:

1.From the desktop, right-click My Computer and click Properties.

2.In the System Properties window, click on the Advanced tab.

3.In the Advanced section, click the Environment Variables button.

4.Finally, in the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon.

For example, if the "gnupilot.exe" is in the C:\Program\gnupilot" you need to add "C:\Program\gnupilot;" at the end of path variable:

enter image description here

0
Sora Minazuki

You can only execute commands which exist in one of the folders specified by the Path environment variable. So unless you specify the full path to gnuplot.exe, you can't run it if it's not in Path. If you are using Windows 10, you can right-click the start menu, click on System > Advanced System Settings > Environment Variables. You will see that there are two types of environment variables, user variables and system variables. User variables are environment variables which applies only to the current user, while system variables apply to the whole system. If you want gnuplot to be in Path regardless of the user account you are using, look for the system variable Path and you will see a semicolon-separated list of file system locations. Add the location of the folder where gnuplot.exe exists, and you will be able to use gnuplot from cmd. Similarly, if you only want to apply changes only to the current user, go ahead and add Path to your user variables, with the location of the folder where gnuplot.exe exists as its value.

EDIT: I guess you could more simply check "Add application directory to your PATH environment variable" when installing gnuplot.

Похожие вопросы