Skip to content Skip to sidebar Skip to footer

"cannot Create Temp Dir For User Data Dir" Error When Not Running As Admin

I'm just able to run my python selenium code when I run it as admin. If I run it normally I get following error: C:\startup>Python C:/startup/startupWebDriverScript.py Trace

Solution 1:

I got the same error and nothing described before helped me. I fixed the problem such a way:

  1. Enter echo %temp% in Windows' command-line
  2. It returned C:\TEMP\2 (Why???)
  3. So I created this folder and after that everything started to work

Solution 2:

Based upon my experience, It is possible you have one of following situations.

  1. Either your disk is getting full, thus don't have enough free disks-pace. Try emptying your recycle bin or check for excessively generated temp files and clear those.

  2. Or you have installed packages using admin privileges and hence your script doesn't have proper privileges to execute.

  3. TMP environment variable may need modifications. right click on computer and then click on properties -> advanced system settings -> environment variables -> "User variables for " and change the TEMP and TMP vars values to "c:\temp".

Solution 3:

Quick solution:

Go to the path C:\Users\Administrator\AppData\Local\Temp, and create a new folder. Rename this new folder to 2

This creates the %temp% folder that was missing.

Solution 4:

After trying a lot of different approaches I decided to downgrade the Chrome web driver and it started to work out fine.

Solution 5:

Ironically, the same error message can be see on when using on Windows 10 with ChromDriver 2.37 / Chrome 65. My test code was running from within Eclipse instance. To resolve, I had to start Eclipse As an Administrator and everything worked as it should.

Post a Comment for ""cannot Create Temp Dir For User Data Dir" Error When Not Running As Admin"