Not able to use 'requests' module in plugin


I was following this tutorial:
After installing the requests module and following the rest I got this error.

This is my first time experience with plugin developement.
So I am not able to figure out how to fix this.

Can someone please help me ?

Here is the snapshot of the same. Including the stack trace



Is your aim to…?
(a) Get THAT specific tutorial up and running
(b) Get to learn how to create a package / add-on / extension in Atom

If your aim is to learn more about the ins-and-outs, perhaps start with

From this Flight Manual is also a ‘tutorial’:

Your thoughts?

- Dan Padric


What does my-package.js look like? The error is being thrown from there.


Hello danPadric,

Thanks for answering.
The focus is definitely on learning, will read the manual.

Any luck in solving this problem though?
May be alternative library or something?


Hey , Here is the code:

'use babel';
import { CompositeDisposable } from 'atom';
import request from 'request'
export default {
  subscriptions: null,
  activate(state) {
    this.subscriptions = new CompositeDisposable();
    this.subscriptions.add(atom.commands.add('atom-workspace', {
      'my-package:fecs': () => this.fecs()
  deactivate() {
  fecs() {
    let editor
    if (editor = atom.workspace.getActiveTextEditor()) {
      let selection = editor.getSelectedText()
  download(url) {
    request(url, (error, response, body) => {
    if (!error && response.statusCode == 200) {


fecs() is the main function which uses download().


…sorry I am just a visitor - I don’t work here. :wink:

let editor

Not knowing enough to be helpful - but isn’t an assignment missing there?


No that is not the problem.( I am sure about that :smile: )


I do believe you’re missing a }, to close the fecs function.


Hey, Guys. I am so terribly sorry.

Yes,that was that.

My bad really. :confounded:


It happens to everyone.


If you don’t know what linters are, they essentially check over your code to make sure everything is :100:. That can mean anything from making sure your code will compile to checking for best practices or enforcing a specific style guide. I would recommend choosing a linter that suits you (check out as a place to start) so that it’s harder for these things to happen in the future :slightly_smiling_face:. Atom then has the corresponding linter and linter-eslint packages that you can install.


…just a thought ->
If one is just starting with experimenting with Atom,
one might not even know about what linters are for.


Yes, I never heard of linters before. Thanks for sharing.Will definitely check out :slight_smile:


I’m learning Python, which has a community that prides itself in modeling after the language creator’s rather particular opinions on how programming should be done, and I’ve set the linter to enforce the official style guide of the language, and conforming to that style (along with thinking critically about how I want to write and why people are saying to do this or that) has really improved my code.