无法新建Jupyter Notebook:Permission denied权限拒绝问题求助
Hey there, let's sort out that "Permission denied" error you're hitting when trying to create a new Python 3 notebook in Jupyter on Windows 10. I've dealt with this exact issue a few times, so here are some practical fixes to try:
1. Launch Command Prompt as Administrator
A lot of the time, this error pops up because your regular CMD session doesn't have the necessary permissions to create files in the default Jupyter directory. Here's how to fix it:
- Find the Command Prompt shortcut (search for "CMD" in the Start menu)
- Right-click it and select Run as administrator
- In this elevated CMD window, run
jupyter notebookagain, then try creating a new Python 3 notebook. This should bypass basic permission blocks.
2. Change Jupyter's Default Save Directory to a User-Controlled Folder
Jupyter often defaults to saving notebooks in system-protected folders (like C:\ or Program Files), which have strict access rules. Let's redirect it to a folder you own:
- First, create a dedicated folder for your notebooks somewhere you have full access, e.g.,
C:\Users\YourUsername\Jupyter_Workspace(replace "YourUsername" with your actual Windows username) - Open an elevated CMD, then run
jupyter notebook --generate-config— this creates a configuration file for Jupyter - Navigate to the config file location (usually
C:\Users\YourUsername\.jupyter\jupyter_notebook_config.py) and open it with a text editor like Notepad or VS Code - Look for the line
#c.NotebookApp.notebook_dir = '' - Remove the
#at the start, then replace the empty quotes with your new folder path (use double backslashes, likec.NotebookApp.notebook_dir = 'C:\\Users\\YourUsername\\Jupyter_Workspace') - Save the config file, restart Jupyter Notebook, and now you should be able to create notebooks in this permission-friendly folder.
3. Verify Python Directory Permissions
If Jupyter is trying to access files in your Python installation directory, you might lack write permissions there:
- Locate your Python install folder (e.g.,
C:\Python310— adjust for your installed version) - Right-click the folder, go to Properties > Security
- Make sure your user account has Read & Write permissions listed. If not, click Edit, add your user account, and grant those permissions
- Apply the changes, then restart Jupyter and test again.
4. Reinstall Jupyter with User-Only Permissions
If all else fails, reinstalling Jupyter to your user directory (instead of system-wide) can eliminate permission conflicts:
- Open a regular CMD (no admin needed) and run
pip uninstall jupyter notebookto remove the current installation - Next, run
pip install --user jupyter notebook— this installs Jupyter in your user profile's app data, where you have full access - Once installed, launch
jupyter notebookand try creating a new notebook.
内容的提问来源于stack exchange,提问作者Vandana Prabhu




