Filenotfounderror winerror 2 The system cannot find the file specified jupyter notebook
After reinstalling Anaconda and opening jupyter notebook, a kernel error appears, FileNotFoundError: [WinError 2] The system cannot find the specified file. Record the resolution process below jupyter kernelspec list
View the installed kernel and location
At this time, I found that the path of python is my original Anaconda path, which I clearly unloaded, no wonder it will report an error.
python -m ipykernel install
View Image 4. Restart jupyter notebookAfter the above steps, jupyter notebook can be used! A lot of programmers have been getting the “filenotfounderror: [winerror 2] the system cannot find the file specified” message and this is a common programming error that can be caused due to a wide variety of different reasons. In this article, we have dedicated ourselves to fixing this issue. After going through a lot of
different user feedback-based messages, we concluded that the following must be the primary reasons due to which this error occurs.
Now that you have been made familiar with most of the reasons, we can finally start implementing the fixes. Fixing the FileNotFoundError: [WinError 2] The system cannot find the file specified issue:Solution 1: Change the Order Of SlashesSometimes the use of incorrect slashes can also trigger this error. So try converting your “Forward Slashes /” into “Backward Slashes \” and vice versa and afterward proceed to check if this fixes your error. Solution 2: Try Setting Up Your Environment
Solution 3: Change Your Environment VariablesFollow the steps below to change your environment variables:
Solution 4: Reconfigure the argv Python PathA few bunches of users reported that this solution also proved to be effective in their case.
3. Lastly, launch the jupyter notebook and check if the python subprocess filenotfounderror: [winerror 2] the system cannot find the file specified error got resolved. Solution 5: Run Python Using CMDIf the thing you’re trying to run is not being set up in the system path then the error can occur too. In order to work with Sublime, you need to be able to open a cmd window and enter the following command: If you are trying to run python then you should be able to see the following message after the execution of this command: C:\Users\Terence>python Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AM D64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>Else, if you get the following message then this means Windows can’t execute the program as it doesn’t know where it is: C:\Users\Terence>python 'python' is not recognized as an internal or external command, operable program or batch file.Solution 6: Reconfigure Shell=True ArgumentIf you do not specify the “Shell=True” argument
in the sub-process module’s run method then you may end up having this error. To solve this error add the “Shell=True” argument in the sub-process module’s run or you can also change “Shell=False” to “Shell=True” and then see if you get rid of the error. Solution 7: Run the Script As An Administrator
Solution 8: Disable Anti-VirusLastly, you may want to confirm if Windows isn’t blocking access to the folder you are trying to make a virtual environment in. So you can temporarily disable your Windows Security features to see if it helps. To do so follow these steps:
Hopefully, careful implementation of the above-indexed fixes will lead you to get rid of the error eventually but if the error still exists then feel free to Contact Us here and we will further troubleshoot it for you. |