Atom script runner не устанавливается

Обновлено: 07.07.2024

как именно настроить путь для Python3.х скриптов для корректной работы? Есть ли другой пакет, который я мог бы использовать?

Если вы используете Mac OS X, Используйте каталог на терминале, чтобы открыть файл.

Выберите файл python3, щелкните правой кнопкой мыши и выберите "получить информацию". Выберите каталог из "Где:" и пройдите его в Atom.

Как Терри сказал тебе:

затем введите python3 в командное пространство.

Он должен работать, Науэль:)

перейдите в строку меню Atom -> пакеты - > скрипт - > настроить Scrpit (Или вы можете использовать сочетание клавиш Shift + Ctrl+Alt+O)

введите python3 в командное пространство. Надеюсь, это сработает.

вы можете использовать пакет Atom atom-python-run чтобы запустить код python из Atom, версия python может быть настроена в настройках пакета. По умолчанию atom-python-run использует синтаксис python . Если команда python в вашей системе еще не указывает на python3, просто замените настройку и напишите python3 .

enter image description here

установите atom-runner в свой Atom, войдя в настройки Atom, а затем внутри пакета и найдите atom-runner и установите его.

enter image description here

Теперь нажмите на вкладку Настройки для atom-runner, как показано выше на рисунке. Затем нажмите на просмотр кода, как показано на рисунке ниже.

затем перейдите в папку lib и откройте atom-runner.кофе и заменить следующий раздел кода:

enter image description here

убедитесь, что для python значение ключевого слова python3, по умолчанию это python. См. рис ниже:


With the auto update to 1.19, script-runner no longer works. Nor does platformio-ide-terminal(another post). I've tried uninstalling, re-installing, npm rebuild, apm upgrade, nothing seems to work .

The text was updated successfully, but these errors were encountered:

ioquatix commented Aug 15, 2017

As an aside, don't use npm to build atom packages.

alsGitHub270 commented Aug 15, 2017

I deleted the script-runner directory and re-installed script-runner from within atom. Exactly the same incompatible error message.

ioquatix commented Aug 15, 2017

I checked my setup and most of the versions I have are the same as you. Something on your system might be causing an issue, but it's hard to know exactly what.

I only had this issue before when I tried to install script-runner with npm install accidentally, and it used the system node.js install instead of the one that comes with atom, and hence it got compiled with the wrong version.

ioquatix commented Aug 16, 2017

Is it some how possible you have multiple copies of Atom installed?

alsGitHub270 commented Aug 16, 2017

This problem occurred following the upgrade of atom to 1.19.0 on Monday. It has since been updated to 1.19.1 behind the scenes. Script-runner was installed prior to this. I installed it from the 'install' section of settings, so I don't know if it's installed via npm. I assume it is installed using apm. I have since uninstalled, deleted the folder as you suggested, and re-installed. The problem still exists.
As an FYI, this started happening the same time the package platfomio-ide-terminal failed due to "some installed packages could not be loaded because they contain native modules that were compiled for an earlier version of Atom". I'm still trying to work this out.

ioquatix commented Aug 16, 2017

/.atom/packages/script-runner try deleting node_modules . Then, in that directory, run apm install . Restart Atom. See if it works.

alsGitHub270 commented Aug 16, 2017

ioquatix commented Aug 16, 2017

what's the output of apm config list

alsGitHub270 commented Aug 16, 2017

Sorry, how to I get that apm config list?

ioquatix commented Aug 16, 2017

run it in the terminal

alsGitHub270 commented Aug 16, 2017

Sorry, brain cramp.

I just saw something that may be revelant or not: I have my machine to run python 3.6 on a 'python' command. I see above python 2.7.

ioquatix commented Aug 16, 2017

What about the version of /usr/bin/python2.7 ? Does that actually start python2.7?

From what I can see you are okay w.r.t. python versions.

ioquatix commented Aug 16, 2017

my version of npm is older than yours. I wonder if that's the issue?

alsGitHub270 commented Aug 16, 2017

npm, Could that have happened with the upgrade? I think yesterday I might have done an npm rebuild or npm install working on the platformio issue.

ioquatix commented Aug 16, 2017

Essentially, the error you are receiving means that apm didn't use the version of Node included in the Atom app. It's building the packages with the wrong Node version. You nominally have one version of Node on your system, and another which is embedded within the Atom.app package. Basically, script-runner needs to be built with the one included with Atom, otherwise it builds the native libraries against the wrong API versions. Hence the error while trying to load node-pty which is the only native dependency I'm aware of. node-pty on your system appears to be getting built against your system's node install, but it should be using the one in the Atom app. Perhaps try downloading a fresh copy of Atom and put it in /Applications . Then trying mv

/.atom /.atom-old and reinstalling all packages.

ioquatix commented Aug 16, 2017

Another thing I'm not sure about is, perhaps the newer version of npm uses a cache, and it's not rebuilding the dependency because it gets it from your system cache (rather than building it fresh for Atom's node install). Perhaps check what packages you have installed globally, and make sure node-pty is not one of them (uninstall it if it is).

alsGitHub270 commented Aug 16, 2017

alsGitHub270 commented Aug 16, 2017

What happened when I moved .atom to .atom-old. It's totally gone, along with all the other packages that I had installed.

ioquatix commented Aug 16, 2017

You can move it back, it contains user config for atom.

ioquatix commented Aug 16, 2017

The problem must be with your system some how, did you check if node-pty was installed in your system?

ioquatix commented Aug 17, 2017

Can you try updating all your globally installed packages?

Then try reinstalling:

alsGitHub270 commented Aug 17, 2017

No change. But what I've notice is that with my problem, as well as a number of others, with platformio-ide-terminal also not working is that that package has two node.py for compiling(?)

With script-runner, there is no multiple builds. How can I tell if pty.node is build 49 instead of 53?

alsGitHub270 commented Aug 17, 2017

Why is it that both my issues occurred after Atom 1.19 was released?

ioquatix commented Aug 17, 2017

I think that some of the build tools were updated.

alsGitHub270 commented Aug 18, 2017

@ioquatix: I just changed the theme on Atom, and lo and behold, a button now to the right of the incompatible message was displayed to 'Rebuild Packages'. I had seen that comment in other comments, but could not see it on my machine. With the new theme, it became visible, and it rebuilt everything. Script-runner now runs like a champ. I appreciate your time and efforts on this.
Al

ioquatix commented Aug 19, 2017

Okay great :) I'm happy it is working for you now.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Я пытаюсь переключиться с Notepad++ на Atom, но мне просто не удается выполнить мои скрипты в Atom.

я следовал ответ (так что я уже установил скрипт), который не очень обширен, а также остальное в Интернете не предлагает ничего понятного для начинающих.

в Notepad++ NPPexec я использовал для

и в Sublime Text 2 я заставил его работать, создав новую " сборку Система":

не могли бы вы указать мне, как настроить Atom, чтобы иметь возможность выполнять скрипты Python с скриптами Python 3.4 с короткой клавиатурой?

Я уже пытался установить мой init-скрипт на:

когда я иду Пакеты -> Скрипт -> Скрипт и типа

это работает. Но это не постоянное решение.

когда я нажимаю Ctrl + Shift+B чтобы запустить скрипт, не настраивая его раньше (так как он должен работать), я получаю (предложение комментария ig0774 реализовано):

enter image description here

(не имеет значения, является ли это C:Python34 или C:Python34 )

он жалуется на то, что python не в моем пути

это можно легко решить, отредактировав /home/.atom/packages/script/lib/grammars.coffee файл (обратите внимание, что папка atom скрыта, поэтому вам может потребоваться нажать ctrl + H для просмотра скрытых файлов и папок)

внутри grammars.coffee найти:

сохраните изменения, перезапустите Atom и наслаждайтесь запуском скриптов с python 3

EDIT: в Windows я считаю, что grammars.coffee файл находится в C:/Users/Your_Username/AppData/Local/atom/packages Опять же, AppData папка скрыта, поэтому вам может потребоваться изменить настройки для просмотра скрытых файлов и папок.

чтобы развернуть ответ @matt-nona. Вы можете перейти к упомянутому конфигурационному файлу прямо из Atom. Просто перейдите в Настройки, затем "Открыть папку конфигурации":

enter image description here

затем / пакеты / скрипт/lib / грамматики.кофе найдите "Python" и внесите соответствующие изменения в python3:

enter image description here

следуя совету Мэтта Ноны, когда Atom запускается - > Welcome Guide (или control+shift+T)-> 5th one down "взломать скрипт Init". Откроется пустая страница, и вы можете добавить туда эти изменения.

Update: для любых других душ, ищущих этот ответ - на моем Mac у меня нет грамматик.файл кофе в файле конфигурации сценария atom.

вместо этого есть папка grammars, и у меня есть python.там папка с кофе. Те же изменения контуров на скриншоте (т. е. добавить " 3 " в конце двух упоминаний python) исправлена моя проблема, и atom автоматически запускает Python3 сейчас.

Не уверен, что приведенные выше ответы специфичны для Windows или если были изменения dev начиная с 2017 года.

Это очевидно, что ENV_PATH здесь неправильно. Я должен пересмотреть его в моем скрипте python.

задание путь внутри Atom не работал, устанавливая его с помощью cmd, через

ни один, и установка его в системных свойствах Windows 7 также не удалась.

переустановка Python 3.4 и добавить python.exe в путь

enter image description here

кажется необходимым. Также мне нужно было удалить Atom вполне (inculding все пакеты или a не менее скрипт) и переустановите его с нуля.

после всех этих шагов:

  • установить Python с добавить в путь
  • Установить Atom
  • установить пакет скрипт

он работает из коробки (Ctrl+Shift+B), и никаких дальнейших шагов не требуется.

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

обновление

переустановить все конечно, не требуется, достаточно просто обновить / восстановить установку с помощью установщика.

" N. B. Эти сочетания клавиш в настоящее время рассматриваются, вход приветствуется. Команда Mac OS X Linux / Windows Выполнить: скрипт ctrl-x alt-x Выполнить: завершить ctrl-c alt-c" И "Run Terminate" (Alt + c), чтобы использовать текущий python в вашей системе.

для Linux и Mac добавление среды в скрипт выберет правильную версию python. ( команда + Я выполнить)

Временно поменял PyCharm на Atom. Проблема заключается в том, что у меня не запускается никакой из пакетов, которые я пытаюсь запустить. Например, я скачал linter и он мне его не запускает, пишет, что мне его нужно засунуть в путь. Устанавливаю atom runner (запуск программы прямо в atom, чтобы не лезть в терминал), пишет:

Загуглил. Засунул python в path. Сделал еще много каких махинаций, но результата не увидел. Скачал пакет script, который делает тоже самое - запускает программу в atom. Также не работает, гуглил и по этому поводу - где-то попробовал решение и не помогло, где-то просто не понял. Скрин с ошибками:

введите сюда описание изображения

PS Изучаю linux не так давно, если это какая-то элементарная проблема не кидайтесь камнями, пожалуйста.

12.3k 7 7 золотых знаков 15 15 серебряных знаков 44 44 бронзовых знака

Решил свою проблему :)

Для решения данной проблемы заходим в Atom → Preferences → Open Config Folder (жмем на кнопку и открываем конфиг атома) → .atom/packages/script/lib/grammars/python.coffee переходим в файл python.coffee и под 'Selection Based' и 'File Based' меняем 'python' на 'python3'

Читайте также: