question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set editor working directory to be the same as the console working directory

See original GitHub issue

Issue Report Checklist

  • [ x] Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • [ x] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

This is a small irritation for me, but I can’t find a way to solve it. Thanks in advance for any suggestions.

I would like the editor working directory (the default save location for new .py files) to be the same as the working directory of the currently active console. Instead, the editor working directory seems to default to either my home directory or the last directory I saved a file in, which results in my regularly saving files in the wrong directory. I can’t seem to find any settings related to the editor working directory.

What I want is for the paths circled in green to be updated whenever the console working directory (red) is changed (see the image below), whether that change comes from navigation or from switching consoles.

Untitled

What steps reproduce the problem?

  1. Save a file in the current console working directory (directory 1)
  2. Change the current console working directory to a new directory (directory 2)
  3. Open a new .py file and save.

What is the expected output? What do you see instead?

I would expect the default save directory to be (directory 2). Instead, the default save directory is (directory 1).

Paste Traceback/Error Below (if applicable)


N/A

Versions

  • Spyder version: 3.3.4
  • Python version: 3.6
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: Windows 10 Home

Dependencies

IPython >=4.0     :  7.4.0 (OK)
cython >=0.21     :  0.29.6 (OK)
jedi >=0.9.0      :  0.13.3 (OK)
matplotlib >=2.0.0:  3.0.3 (OK)
nbconvert >=4.0   :  5.4.1 (OK)
numpy >=1.7       :  1.14.5 (OK)
pandas >=0.13.1   :  0.23.4 (OK)
pycodestyle >=2.3 :  2.5.0 (OK)
pyflakes >=0.6.0  :  2.1.1 (OK)
pygments >=2.0    :  2.3.1 (OK)
pylint >=0.25     :  2.3.1 (OK)
qtconsole >=4.2.0 :  4.4.3 (OK)
rope >=0.9.4      :  0.12.0 (OK)
sphinx >=0.6.6    :  1.8.5 (OK)
sympy >=0.7.3     :  1.3 (OK)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ccordoba12commented, Apr 16, 2019

This is not that hard to do. We’ll try to implement it for Spyder 4.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set working directory pemanently in Spyder & RStudio?
In Spyder (since version 3.2) you need to go to. Tools > Preferences > Current working directory. and select the option called.
Read more >
How to change the working directory for specific files
Set console working directory in Spyder. I would like to do something similar in PyCharm. Navigate freely in files and folders without ...
Read more >
Directory.SetCurrentDirectory(String) Method (System.IO)
Sets the application's current working directory to the specified directory.
Read more >
Running RStudio and Setting Up Your Working Directory
You can change the default working directory from RStudio menu under: Tools –> Global options –> click on “Browse” to select the default...
Read more >
Working Directories and Workspaces in the RStudio IDE
The current working directory is displayed by the RStudio IDE within the title region of the Console pane. You can also check your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found