Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autopep8 Fails when beautifying Python #274

Closed
ghost opened this issue Apr 10, 2015 · 8 comments
Closed

autopep8 Fails when beautifying Python #274

ghost opened this issue Apr 10, 2015 · 8 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Apr 10, 2015

Get the following errors when trying to beautify Python, on osx yosemite:

screen shot 2015-04-10 at 22 56 22
screen shot 2015-04-10 at 22 56 48

Additionally I can use pep8 fine and I have added the path in the settings.

@fd
Copy link

fd commented Apr 28, 2015

I'm having the same problem

Update:

I'm using zsh not bash. so removing the .bashrc loaders fixed the problem for me.

@Glavin001
Copy link
Owner

Thanks for letting me know. This will all be resolved when I get rid of the .bashrc code. See #282 and #164.

@Glavin001 Glavin001 added the bug label Apr 28, 2015
@Glavin001 Glavin001 added this to the v1.0.0 milestone Apr 28, 2015
@Glavin001 Glavin001 self-assigned this Apr 28, 2015
@Glavin001
Copy link
Owner

Published to v0.25.0

This is a very big release with lots of internal changes and (hopefully) no breaking changes. Please let me know if you are experiencing any unusual behaviour / breaking changes after updating. Thank you.

@Glavin001
Copy link
Owner

@fd is v0.25.0 + working for you? This issue should no longer be applicable, so feel free to create a new issue if one for your new problem does not already exist.

@muppetjones
Copy link

Atom ver: 0.196.0

I just updated to 0.26.5, and I'm getting the span autopep8 ENOENT error as well. I do have autopep8 installed (and I just checked for an upgrade just in case).

Error: spawn autopep8 ENOENT
  at exports._errnoException (util.js:734:11)
  at Process.ChildProcess._handle.onexit (child_process.js:1035:32)
  at child_process.js:1127:20
  at process._tickCallback (node.js:357:13)

@Glavin001
Copy link
Owner

Could you run Help Debug Editor

@muppetjones
Copy link

Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Tue May 05 2015 13:32:18 GMT-0500 (CDT).


Platform: darwin

Versions

Atom Version: 0.196.0

Atom Beautify Version: 0.26.5

Original file to be beautified

Original File Path: /Users/fake_user/dev/remsci/dummy_file.py

Original File Grammar: Python

Original File Contents:

from unittest import TestCase


class Bar(TestCase):

    def fakefunction(param, second_param):
        pass

    def test_indentation(self):
        foo = self.fake_function(param='hello',
                                 second_param='world',
                                 )
        bar = 'after_continuing typing'
        return foo, bar

Beautification options

Editor Options:
Options from Atom Editor settings

{
    "indent_size": 4,
    "indent_char": " ",
    "indent_with_tabs": false
}

Config Options:
Options from Atom Beautify package settings

{
    "python": {
        "autopep8_path": "/Users/fake_user/venv/default/bin/autopep8",
        "max_line_length": 79,
        "indent_size": 4,
        "ignore": [
            "E24"
        ]
    },
    "cs": {
        "configPath": ""
    },
    "c": {
        "configPath": ""
    },
    "cpp": {
        "configPath": ""
    },
    "css": {
        "indent_size": 4,
        "indent_char": " ",
        "selector_separator_newline": false,
        "newline_between_rules": false,
        "preserve_newlines": false
    },
    "d": {
        "configPath": ""
    },
    "html": {
        "indent_inner_html": false,
        "indent_size": 4,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_line_length": 250,
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 4,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "unformatted": [
            "a",
            "sub",
            "sup",
            "b",
            "i",
            "u"
        ],
        "end_with_newline": false
    },
    "java": {
        "configPath": ""
    },
    "js": {
        "indent_size": 4,
        "indent_char": " ",
        "indent_level": 0,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "space_in_paren": false,
        "jslint_happy": false,
        "space_after_anon_function": false,
        "brace_style": "collapse",
        "break_chained_methods": false,
        "keep_array_indentation": false,
        "keep_function_indentation": false,
        "space_before_conditional": true,
        "eval_code": false,
        "unescape_strings": false,
        "wrap_line_length": 0,
        "end_with_newline": false
    },
    "objectivec": {
        "configPath": ""
    },
    "pawn": {
        "configPath": ""
    },
    "perl": {
        "perltidy_profile": ""
    },
    "php": {
        "fixers": "",
        "level": ""
    },
    "sql": {
        "indent_size": 4,
        "keywords": "upper",
        "identifiers": "lower"
    },
    "vala": {
        "configPath": ""
    }
}

Home Options:
Options from /Users/fake_user/.jsbeautifyrc

{}

EditorConfig Options:
Options from EditorConfig file

{}

Project Options:
Options from .jsbeautifyrc files starting from directory /Users/fake_user/dev/remsci and going up to root

[
    {},
    {},
    {},
    {}
]

Results

Beautified File Contents:

Error: spawn autopep8 ENOENT

Logs:

2015-05-05T18:32:18.183Z - info: [/Users/fake_user/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautify 
from unittest import TestCase


class Bar(TestCase):

    def fakefunction(param, second_param):
        pass

    def test_indentation(self):
        foo = self.fake_function(param='hello',
                                 second_param='world',
                                 )
        bar = 'after_continuing typing'
        return foo, bar
 [ { indent_size: 4, indent_char: ' ', indent_with_tabs: false },
  { python: 
     { autopep8_path: '/Users/fake_user/venv/default/bin/autopep8',
       max_line_length: 79,
       indent_size: 4,
       ignore: [Object] },
    cs: { configPath: '' },
    c: { configPath: '' },
    cpp: { configPath: '' },
    css: 
     { indent_size: 4,
       indent_char: ' ',
       selector_separator_newline: false,
       newline_between_rules: false,
       preserve_newlines: false },
    d: { configPath: '' },
    html: 
     { indent_inner_html: false,
       indent_size: 4,
       indent_char: ' ',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_line_length: 250,
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 4,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       unformatted: [Object],
       end_with_newline: false },
    java: { configPath: '' },
    js: 
     { indent_size: 4,
       indent_char: ' ',
       indent_level: 0,
       indent_with_tabs: false,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       space_in_paren: false,
       jslint_happy: false,
       space_after_anon_function: false,
       brace_style: 'collapse',
       break_chained_methods: false,
       keep_array_indentation: false,
       keep_function_indentation: false,
       space_before_conditional: true,
       eval_code: false,
       unescape_strings: false,
       wrap_line_length: 0,
       end_with_newline: false },
    objectivec: { configPath: '' },
    pawn: { configPath: '' },
    perl: { perltidy_profile: '' },
    php: { fixers: '', level: '' },
    sql: { indent_size: 4, keywords: 'upper', identifiers: 'lower' },
    vala: { configPath: '' } },
  {},
  {},
  {},
  {},
  {},
  {} ] Python /Users/fake_user/dev/remsci/dummy_file.py
2015-05-05T18:32:18.183Z - verbose: [/Users/fake_user/.atom/packages/atom-beautify/src/beautifiers/index.coffee] Python name=Python, namespace=python, grammars=[Python], extensions=[py], type=integer, default=79, description=set maximum allowed line length (Supported by autopep8), title=Python - Max line length, beautifiers=[autopep8], type=integer, default=4, minimum=0, description=Indentation size/length (Supported by autopep8), title=Python - Indent size, beautifiers=[autopep8], type=array, default=[E24], type=string, description=do not fix these errors/warnings (Supported by autopep8), title=Python - Ignore, beautifiers=[autopep8], beautifiers=[autopep8]
2015-05-05T18:32:18.183Z - verbose: [/Users/fake_user/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautifier autopep8 silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, languages=[Python], �[1;36mBASH �[1;31m3.2�[m - DISPLAY on �[1;31m/private/tmp/com.apple.launchd.O3V8Ukoszc/org.macosforge.xquartz:0�[m=undefined, Tue May  5 13:32:10 CDT 2015=undefined, �[1;35m=undefined, It is not doing the thing we like to do, but liking the thing we have to do,=undefined, that makes life blessed.=undefined,      -- Goethe=undefined, �[m=undefined, GIT_PS1_SHOWDIRTYSTATE=true, PIP_DOWNLOAD_CACHE=/Users/fake_user/.pip/cache, LESS_TERMCAP_mb=�[01;31m, LESS_TERMCAP_md=�[01;31m, PIP_REQUIRE_VIRTUALENV=true, LESS_TERMCAP_me=�[0m, SHELL=/bin/bash, CLICOLOR=1, TMPDIR=/var/folders/dg/_x_l7t090hqc074zc54h418c0000gn/T/, BOWTIE2_INDEXES=/Users/fake_user/work/RemSeq/genome/, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.Fp2PZdQUak/Render, LESS_TERMCAP_ue=�[0m, ATOM_HOME=/Users/fake_user/.atom, USER=fake_user, TIMEFORMAT=, real %3R user %3U    sys %3S pcpu %P=undefined, LD_LIBRARY_PATH=/usr/local/ngs/ngs-sdk/lib64:, COMMAND_MODE=unix2003, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.y6YCPLAfV3/Listeners, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, PAGER=less, WORKON_HOME=/Users/fake_user/.virtualenvs, LESS_TERMCAP_us=�[01;32m, LSCOLORS=ExFxBxDxCxegedabagacad, PROJECT_HOME=/Users/fake_user/dev, GOOGLE_API_KEY=AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q, PATH=/opt/local/bin:/opt/local/sbin:/Users/fake_user/local/bin:/usr/local/bin:/Users/fake_user/Dropbox/bin:/Users/fake_user/local/lib:/Users/fake_user/Dropbox/lib:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin, PWD=/, NGS_BAM_LIBDIR=/usr/local/ngs/ngs-bam/lib64, BOWTIE_INDEXES=/Users/fake_user/work/RemSeq/genome/, NODE_PATH=/Applications/Atom.app/Contents/Resources/app.asar/exports, XPC_FLAGS=0x0, NODE_ENV=production, GIT_PS1_SHOWUNTRACKEDFILES=true, HISTIGNORE=&:bg:fg:ll:h, HISTCONTROL=ignoredups, XPC_SERVICE_NAME=0, LESSCHARSET=latin1, NGS_LIBDIR=/usr/local/ngs/ngs-sdk/lib64, SHLVL=1, HOME=/Users/fake_user, LESS=-i -N -w  -z-4 -g -e -M -X -F -R -P%t?f%f \, :stdin .?pb%pb\%:?lbLine %lb:?bbByte %bb:-...=undefined, PYTHONPATH=/Users/fake_user/dev/scripts:, LOGNAME=fake_user, LESS_TERMCAP_so=�[01;44;33m, CLASSPATH=/usr/local/ngs/ngs-java/jar/ngs-java.jar:, LESSOPEN=|/usr/bin/lesspipe.sh %s 2>&-, ARCHFLAGS=-arch x86_64, DISPLAY=/private/tmp/com.apple.launchd.O3V8Ukoszc/org.macosforge.xquartz:0, HOSTFILE=/Users/fake_user/.hosts, HISTTIMEFORMAT=[%d/%m %H:%M:%S] , LESS_TERMCAP_se=�[0m, _=/usr/bin/env, \e[1;31mHasta la vista, baby\e[m=undefined, _envCacheDate=Tue May 05 2015 13:32:10 GMT-0500 (CDT)
2015-05-05T18:32:18.184Z - debug: [/Users/fake_user/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] tempFile input null path=/var/folders/dg/_x_l7t090hqc074zc54h418c0000gn/T/input11545-17456-3jxw1n, fd=39
2015-05-05T18:32:18.185Z - debug: [/Users/fake_user/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] spawn autopep8 0=/var/folders/dg/_x_l7t090hqc074zc54h418c0000gn/T/input11545-17456-3jxw1n, 1=--max-line-length, 2=79, 3=--indent-size, 4=4, 5=--ignore, 6=E24
2015-05-05T18:32:18.193Z - debug: [/Users/fake_user/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] error Error: spawn autopep8 ENOENT
  at exports._errnoException (util.js:734:11)
  at Process.ChildProcess._handle.onexit (child_process.js:1035:32)
  at child_process.js:1127:20
  at process._tickCallback (node.js:357:13)


@Glavin001
Copy link
Owner

@muppetjones , thanks for creating a separate issue, #322. I will follow up with you there, since this is a different error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants