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.

PermissionError when Spyder is started

See original GitHub issue

Error encountered when i open spyder

File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\external\lockfile.py”, line 88, in symlink rename(newlinkname, filename) PermissionError: [WinError 5] Access is denied: ‘C:\Users\mzeeqazi\.spyder-py3\spyder.lock.1517167725983.newlink’ -> ‘C:\Users\mzeeqazi\.spyder-py3\spyder.lock’

Traceback (most recent call last): File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\app\start.py”, line 118, in main lock_created = lock.lock() File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\external\lockfile.py”, line 150, in lock symlink(str(os.getpid()), self.name) File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\external\lockfile.py”, line 91, in symlink os.rmdir(newlinkname) OSError: [WinError 145] The directory is not empty: ‘C:\Users\mzeeqazi\.spyder-py3\spyder.lock.1517167725983.newlink’

Traceback (most recent call last): File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins_init_.py”, line 511, in <lambda> toggled=lambda checked: self.toggle_view(checked), File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole.py”, line 713, in toggle_view self.create_new_client(give_focus=False) File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole.py”, line 1009, in create_new_client self.connect_client_to_kernel(client) File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole.py”, line 1035, in connect_client_to_kernel stderr_file) File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole.py”, line 1440, in create_kernel_manager_and_kernel_client kernel_manager.start_kernel(stderr=stderr) File “D:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\manager.py”, line 257, in start_kernel **kw) File “D:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\manager.py”, line 203, in _launch_kernel return launch_kernel(kernel_cmd, **kw) File “D:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\launcher.py”, line 128, in launch_kernel proc = Popen(cmd, **kwargs) File “D:\ProgramData\Anaconda3\lib\subprocess.py”, line 709, in init restore_signals, start_new_session) File “D:\ProgramData\Anaconda3\lib\subprocess.py”, line 997, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified

Version and main components

  • Spyder Version: 3.2.4
  • Python Version: 3.6.3
  • Qt Versions: 5.6.2, PyQt5 5.6 on Windows

Dependencies

pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
numpy >=1.7      :  1.13.3 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
rope >=0.9.4     :  0.10.5 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
cython >=0.21    :  0.26.1 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.1.0 (OK)
pylint >=0.25    :  1.7.4 (OK)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ccordoba12commented, Feb 3, 2018

@dalthviz, please work on this one. The idea is to address this problem

File “D:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\external\lockfile.py”, line 88, in symlink rename(newlinkname, filename) PermissionError: [WinError 5] Access is denied: ‘C:\Users\mzeeqazi.spyder-py3\spyder.lock.1517167725983.newlink’ -> ‘C:\Users\mzeeqazi.spyder-py3\spyder.lock’

To solve it, we need to catch IOError and OSError around these lines

https://github.com/spyder-ide/spyder/blob/3.x/spyder/utils/external/lockfile.py#L91-L92

and pass in the except part.

1reaction
ccordoba12commented, Jan 29, 2018

Thanks for reporting the full error @mzeeqazi! That was what made me finally realize the source of this problem: the removal of the conda environment used to start our kernels. So the second part of your problem is a duplicate of issue #4958.

You have two options to fix it until we do:

  1. Run in a system terminal (cmd.exe) spdyer --reset.
  2. Go to Preferences > Python interpreter and select either the Default interpreter or a new custom one.
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix the permission denied error? (happens in any IDE)
Just go to logo of spyder if standalone , right click and run as administrator , or if anaconda then run anaconda as...
Read more >
Python PermissionError: [errno 13] permission denied Solution
The PermissionError: [errno 13] permission denied error occurs when you try to access a file from Python without having the necessary ...
Read more >
spyder-ide/public - Gitter
For context, I am trying to load in a dataset once by running the runfile, then commenting out said line ... PermissionError: [Errno...
Read more >
Anaconda Spyder Save / Write Permission Denied on ...
Spyder won't let me write or save to subfolder in "Documents" (Errno 13, permission denied). It will let me do so to Desktop....
Read more >
Troubleshooting - Anaconda Documentation
Navigator error on start up; Issues launching or initializing; PermissionError on ... prompt by launching Spyder and running the following in the console:....
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