Skip to content

[Win10] Can't change current working directory if atom is not started using 'atom .' command. #1025

@goddessfreya

Description

@goddessfreya

Recently I was struggling with changing the working directory of my python program.
If 'Current Working Directory' was not empty, trying to run would give an error when trying to be run.

Dependencies:
Python 3.5.2

Steps:
1- Insure no other copy of atom is running
2- Open Atom through the shortcut which appears in the Start Menu.
(Target: %AppData%..\Local\atom\Update.exe --processStart atom.exe
Start In: %AppData%..\Local\atom\app-1.9.1)
3- Press Ctrl-N then type "print("Hi")" into the new file
4- Press Ctrl-S then save it somewhere.
5- Press Ctrl-Shift-B, insure it runs.
6- Press Alt-Ctrl-Shift-O
7- Under 'Current Working Directory' type the relative path to a other directory, in my case that was 'data'
8- Press run. You will get something like this this:

Unable to run

python

Did you start Atom from the command line?

atom .

Is it in your PATH?

PATH: C:\Python35-32\Scripts;**C:\Python35-32**;C:\tools\ruby23\bin;%Path2%;C:\Projects\Dev\Tools\CMake\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\TortoiseGit\bin;C:\Projects\Dev\Tools\Chocolatey\bin;C:\Program Files\nodejs;C:\Program Files\Git;C:\Program Files\Git\bin;C:\Users\Gentz.dnx\bin;C:\Users\Gentz\AppData\Roaming\npm;C:\Users\Gentz\AppData\Local\atom\bin;C:\Python2.7;C:\Python27;C:\Python3.4;C:\Python34;C:\Python3.5;C:\Python35;C:\Program Files (x86)\Python 2.7;C:\Program Files (x86)\Python 3.4;C:\Program Files (x86)\Python 3.5;C:\Program Files (x64)\Python 2.7;C:\Program Files (x64)\Python 3.4;C:\Program Files (x64)\Python 3.5;C:\Program Files\Python 2.7;C:\Program Files\Python 3.4;C:\Program Files\Python 3.5

How to fix it:
1- Close all instances of atom
2- Open cmd.exe with elevated permissions.
3- Type 'cd [diorectory where you saved the thing]' then hit enter then type "atom ." then hit enter
4- Open the file you saved
5- Press Ctrl-Shift-B, insure it runs.
6- Press Alt-Ctrl-Shift-O
7- Under 'Current Working Directory' type the relative path to a other directory, in my case that was 'data'
8- Press run, now it will work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions