Spyder: No such file or directory

Created on 29 Aug 2017  路  7Comments  路  Source: spyder-ide/spyder

Description

What steps will reproduce the problem?

  1. run a script by pressing F5

What is the expected output? What do you see instead?
The script runs normaly after it finishes I get an error message from Spyder

Please provide any additional information below

File "c:\python27\lib\site-packages\spyder\plugins\ipythonconsole.py", line 898, in set_working_directory
refresh_console=False)
File "c:\python27\lib\site-packages\spyder\plugins\workingdirectory.py", line 287, in chdir
self.refresh_plugin()
File "c:\python27\lib\site-packages\spyder\plugins\workingdirectory.py", line 203, in refresh_plugin
self.save_wdhistory()
File "c:\python27\lib\site-packages\spyder\plugins\workingdirectory.py", line 233, in save_wdhistory
encoding.writelines(text, self.LOG_PATH)
File "c:\python27\lib\site-packages\spyder\utils\encoding.py", line 236, in writelines
return write(os.linesep.join(lines), filename, encoding, mode)
File "c:\python27\lib\site-packages\spyder\utils\encoding.py", line 227, in write
with open(filename, mode) as textfile:
IOError: [Errno 2] No such file or directory: u'\Users\xxx\.spyder\workingdir'

Version and main components

  • Spyder Version: 3.2.1
  • Python Version: 2.7.10
  • Qt Versions: 4.8.6, PyQt4 (API v2) 4.11.3 on Windows

Dependencies

```
pyflakes >=0.5.0 : 1.6.0 (OK)
pycodestyle >=2.3 : 2.3.1 (OK)
pygments >=2.0 : 2.2.0 (OK)
pandas >=

IPython Console Bug

Most helpful comment

Wow, another closed and unresolved issue, The anaconda team are pretty slack it seems, going off anaconda big time

All 7 comments

Please run

spyder --reset

in a system terminal (cmd.exe) and try again.

spyder --reset did not help

I narrowred it further down:

What steps will reproduce the problem?

  1. I did spyder --reset
  2. I started spyder from a terminal in folder A
  3. I loaded a script from folder A, I ran it
  4. When I was asked for the configuration to run the script I chose:
    Console:

    • Execute in current console

    General settings:

    • noting selected

    Working Directory settings:

    • The current directory of the file being executed

    Other Settings:

    • nothing selected
  5. When I run a scipt from folder A it's fine

  6. When I run a script from an other folder I get the error message

I have no idea why this is happening, sorry. We'll try to take a look at this in a future release.

(base) C:\Users\Daniyal\Anaconda3>spyder
Traceback (most recent call last):
File "C:\Users\Daniyal\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3126, in main
mainwindow = run_spyder(app, options, args)
File "C:\Users\Daniyal\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3023, in run_spyder
main.setup()
File "C:\Users\Daniyal\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 840, in setup
self.workingdirectory = WorkingDirectory(self, self.init_workdir, main=self)
File "C:\Users\Daniyal\Anaconda3\lib\site-packages\spyder\plugins\workingdirectory.py", line 159, in __init__
self.chdir(workdir)
File "C:\Users\Daniyal\Anaconda3\lib\site-packages\spyder\plugins\workingdirectory.py", line 296, in chdir
self.refresh_plugin()
File "C:\Users\Daniyal\Anaconda3\lib\site-packages\spyder\plugins\workingdirectory.py", line 204, in refresh_plugin
self.save_wdhistory()
File "C:\Users\Daniyal\Anaconda3\lib\site-packages\spyder\plugins\workingdirectory.py", line 234, in save_wdhistory
encoding.writelines(text, self.LOG_PATH)
File "C:\Users\Daniyal\Anaconda3\lib\site-packages\spyder\utils\encoding.py", line 236, in writelines
return write(os.linesep.join(lines), filename, encoding, mode)
File "C:\Users\Daniyal\Anaconda3\lib\site-packages\spyder\utils\encoding.py", line 227, in write
with open(filename, mode) as textfile:
FileNotFoundError: [Errno 2] No such file or directory: '%DANIYAL\.spyder-py3\workingdir'

This is fixed now.

Wow, another closed and unresolved issue, The anaconda team are pretty slack it seems, going off anaconda big time

this issue is fixed

-------------------------------------------------------------------------------------------------------------------

CODE
/home/ak/Desktop/automate_access
/home/ak/Desktop/automate_access
Traceback (most recent call last):

File "/home/ak/.config/spyder-py3/temp.py", line 7, in
file1 = open(r'api_key.txt')

FileNotFoundError: [Errno 2] No such file or directory: 'api_key.txt'

Was this page helpful?
0 / 5 - 0 ratings