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.

FileNotFoundError when opening or saving files in network drives

See original GitHub issue

Description

What steps will reproduce the problem?

I don’t know how to reproduce. I’d just opened a script and and clicked the Debug button Spyder’s toolbar. It took about 10 seconds to respond with this error.

Traceback

  File "C:\Users\greg\Anaconda3\envs\nwra3\lib\ntpath.py", line 647, in realpath
    path = _getfinalpathname(path)
FileNotFoundError: [WinError 53] The network path was not found: '\\\\kraken\\buildbot\\built_executables\\assemble_distributables.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\greg\Anaconda3\envs\nwra3\lib\site-packages\spyder\plugins\ipythonconsole\plugin.py", line 388, in <lambda>
    self.main.editor.load(fname, lineno, word,
  File "C:\Users\greg\Anaconda3\envs\nwra3\lib\site-packages\spyder\plugins\editor\plugin.py", line 2016, in load
    current_editor = self.set_current_filename(filename,
  File "C:\Users\greg\Anaconda3\envs\nwra3\lib\site-packages\spyder\plugins\editor\plugin.py", line 1552, in set_current_filename
    return editorstack.set_current_filename(filename, focus)
  File "C:\Users\greg\Anaconda3\envs\nwra3\lib\site-packages\spyder\plugins\editor\widgets\editor.py", line 1665, in set_current_filename
    index = self.has_filename(filename)
  File "C:\Users\greg\Anaconda3\envs\nwra3\lib\site-packages\spyder\plugins\editor\widgets\editor.py", line 1659, in has_filename
    if fixpath(filename) == fixpath(finfo.filename):
  File "C:\Users\greg\Anaconda3\envs\nwra3\lib\site-packages\spyder\plugins\editor\widgets\editor.py", line 1657, in <lambda>
    fixpath = lambda path: osp.normcase(osp.realpath(path))
  File "C:\Users\greg\Anaconda3\envs\nwra3\lib\ntpath.py", line 651, in realpath
    path = _getfinalpathname_nonstrict(path)
  File "C:\Users\greg\Anaconda3\envs\nwra3\lib\ntpath.py", line 601, in _getfinalpathname_nonstrict
    path = _getfinalpathname(path)
FileNotFoundError: [WinError 53] The network path was not found: '\\\\kraken\\buildbot\\built_executables\\assemble_distributables.py'

Versions

  • Spyder version: 4.1.5
  • Python version: 3.8.5
  • Qt version: 5.9.7
  • PyQt5 version: 5.9.2
  • Operating System: Windows 10

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.6.0 (OK)
diff_match_patch >=20181111    :  20200713 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.19.0 (OK)
jedi =0.17.1                   :  0.17.1 (OK)
nbconvert >=4.0                :  6.0.7 (OK)
numpydoc >=0.6.0               :  1.1.0 (OK)
paramiko >=2.4.0               :  2.7.2 (OK)
parso =0.7.0                   :  0.7.0 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.2 (OK)
pygments >=2.0                 :  2.7.2 (OK)
pylint >=1.0                   :  2.6.0 (OK)
pyls >=0.34.0;<1.0.0           :  0.35.1 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  1.0.1 (OK)
qtconsole >=4.6.0              :  4.7.7 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.2.1 (OK)
spyder_kernels >=1.9.4;<1.10.0 :  1.9.4 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  19.0.2 (OK)

# Optional:
cython >=0.21                  :  0.29.21 (OK)
matplotlib >=2.0.0             :  3.3.2 (OK)
numpy >=1.7                    :  1.19.2 (OK)
pandas >=0.13.1                :  1.1.3 (OK)
scipy >=0.17.0                 :  1.5.2 (OK)
sympy >=0.7.3                  :  1.6.2 (OK)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
sound-fxcommented, Mar 15, 2021

Sorry for the slow follow-up.

At @dalthviz 's suggestion, I was able to able to reproduce the problem in Spyder v. 4.1.5:

  1. Start that script (that resides on a network drive) in debug mode.
  2. After hitting a breakpoint, disconnect from the network.
  3. Upon clicking the Run Current Line button on the toolbar (to advance the debugger to the next line), Spyder displays the error message that the file could not be found and offers to either close the file or keep it open.
  4. Clicking to keep the file open, Spyder shows the exception dialog with the traceback and the option to report the error.

Following those same steps using Spyder v. 4.2.1, I confirm that everything works as expected. Steps 1 - 3 seem to behave the same in both 4.1.5 and 4.2.1, but in Step 4 (clicking to keep the file open) quietly leaves the file open, with no further error dialog, so no offer to send the traceback along with details.

Thank you for the suggestions and for the great software!

1reaction
miklos-zoldicommented, Apr 29, 2022

Hi Daniel,

I reported the issue o Github just now, I was out of town for a bit, hence the delay.

Thank you guys for your help! Miklos

Daniel Althviz Moré @.***> ezt írta (időpont: 2022. ápr. 15., P, 12:09):

Oh I see @miklos-zoldi https://github.com/miklos-zoldi then could you open a new issue with all your setup details and traceback to check again this please? Thanks!

— Reply to this email directly, view it on GitHub https://github.com/spyder-ide/spyder/issues/14660#issuecomment-1100201995, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIDA4MQ3OEZXD3IWI4XCEFDVFGIDBANCNFSM4WXSIWHQ . You are receiving this because you were mentioned.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

FileNotFoundError: [Errno 2] - Possible work network issue?
To open and read a file specify the filename in your path: myfile = open("U:/matrix_neo/word ... The U: is a mapped drive in...
Read more >
Python FileNotFoundError: [Errno 2] No such file or directory ...
This error tells you that you are trying to access a file or folder that does not exist. To fix this error, check...
Read more >
Visio 2013 Opening .vsd file on Network Drive has File Not ...
I can try to open the file through open file in Visio, finding the file, and selecting open. Same File Not Found error....
Read more >
How to Fix the "Network Path Was Not Found" Error on Windows
While you are at it, we also recommend checking if the device you want to share files with has the sharing feature enabled....
Read more >
Mapped network drive not showing when opening or saving ...
Mapped network drive not showing when opening or saving file in PowerMill, PowerInspect. Products and versions covered.
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