This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: 3.5 Win install fails with "TARGETDIR"
Type: Stage: resolved
Components: Installation Versions: Python 3.6, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: Claude, OBSOLETE, Per Fryking, WadeH, Yu Zhigang, basuj81, cbj4074, ivan.radic, lac, maubp, paul.moore, python-dev, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2015-09-16 17:35 by fov, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
Python 3.5.0 (32-bit)_20150916132422.log fov, 2015-09-17 13:45
python install Yu Zhigang, 2017-08-16 06:04 The log of Python installer
Python 3.6.3 (32-bit)_20171120135800.log Per Fryking, 2017-11-20 13:05 TARGETDIR not set error
Messages (19)
msg250857 - (view) Author: Felipe (fov) * Date: 2015-09-16 17:35
The 3.5 Windows installer fails with "The TARGETDIR variable must be provided when invoking this installer"

Here are the steps I followed:

1. Initial screen:

   - uncheck the add path and all users options
   - select "Customize installation"

2. Optional features:

   - Check all boxes except "all users"

3. Advanced options

   - Uncheck all
   - Pick a different path to install to (clean folder)

4. A message box pops up saying "The TARGETDIR variable must be provided when invoking this installer" -- I hit OK.

5. Final screen showing 0x8007063 - Fatal error during installation

I've saved the log file and can upload if helpful, but will have to remove personal info first
msg251375 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-09-23 01:00
Well, I made this happen once, but not a second time. That's better than most setup issues I get to deal with :)

Still working on it - will post when I figure it out.
msg253734 - (view) Author: Peter (maubp) Date: 2015-10-30 14:46
We just hit this bug with "The TARGETDIR variable must be provided when invoking this installer" and an OK button (only) on a colleagues' machine.

We first tried (default options) and then (default options plus checked add to PATH) with the same problem.

My colleague recalls having previously installed and then removed Python 3.5 on this machine (possibly a pre-release or beta version). Could anything in the registry or on left disk trigger this?
msg253738 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-10-30 15:26
That's a good idea.

Can you grab the log files from %UserProfile%\AppData\Local\Temp (sort by date - they'll all be grouped together) and upload to this issue? 

Like Felipe, you may want to censor some usernames/paths. If you do, please let me know if they contain anything other than letters or digits (spaces and punctuation may be very important here).
msg253747 - (view) Author: Laura Creighton (lac) Date: 2015-10-30 16:46
webmaster just got mail from another person hit with this on Windows 10.
msg253751 - (view) Author: Wade Hedrick (WadeH) Date: 2015-10-30 18:32
I had the same problem when trying to install 3.5 with Windows 10. I got the same results as Felipe has listed in the post from 9/16.
msg255817 - (view) Author: Ben (cbj4074) Date: 2015-12-03 13:26
Still a problem with python-2.7.10.amd64.msi. A bit surprising that this has not been addressed since 2015.05.23...
msg256226 - (view) Author: Ivan Radic (ivan.radic) Date: 2015-12-11 18:38
I got this with 3.5.1 installer on Windows 7. I solved it by running installer with elevated privileges. Installer for 2.7.11 was not affected.
msg256227 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-12-11 19:08
Good to hear there's a workaround.

I seem to recall an issue in the past with some security policies that disallow passing parameters to installers. This may be the cause here. When I get a chance to sit at a computer I'll see if I can track that down.
msg261144 - (view) Author: Claude Chouinard (Claude) Date: 2016-03-03 00:06
To solve the problem with the variable TARGETDIR not being initialized, I called the installation program from the command shell and added the target dir option.

c:\Users\xxxx\Downloads>python-3.5.1-amd64.exe TargetDir=c:\Python35

I also us the custom installation option (using the Install Now might not work). You should see that the target dir is properly setup to what you have specified.

Now it installed without a problem.
msg270418 - (view) Author: OBSOLETE (OBSOLETE) Date: 2016-07-14 15:57
For me the custom installer worked by combining the two solutions above:

1. open an elevated command prompt
2. run the installer by specifying the TargetDir
msg273115 - (view) Author: Jagannath Basu (basuj81) Date: 2016-08-19 12:49
I ran the python-3.5.2.exe file as administrator (right click > Run as Admin) and then followed the custom installation to set up target directory. It got installed without further complaints.
msg275496 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-09 23:39
New changeset 16d652760a06 by Steve Dower in branch '3.5':
Issue #25144: Ensures TargetDir is set before continuing with custom install.

New changeset 024f3312ccee by Steve Dower in branch 'default':
Issue #25144: Ensures TargetDir is set before continuing with custom install.
msg275497 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-09 23:40
I believe this change will fix it, or at least provide some more diagnostic info if it fails again. There doesn't seem to be any other way to trigger the install process without setting a target directory.
msg300290 - (view) Author: Yu Zhigang (Yu Zhigang) Date: 2017-08-15 09:32
It's quite an issue... This is 2017 and it's still there. Anyway, I encountered the same problem by running the installer in Win7, and it was fixed by running it again in administrative mode.
msg300299 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2017-08-15 15:23
Yu Zhigang - can you post your install logs from the failed install? You'll notice in my last message I said that I added some extra logging.

However, it sounds like you have a certain system option set that essentially breaks paths passed between non-admin and admin processes. There is very little we can do about that, and the fix applied for this issue is not intended to solve it.
msg300328 - (view) Author: Yu Zhigang (Yu Zhigang) Date: 2017-08-16 06:04
Hi, if everything goes well you shall see the log in the attachment or somewhere. I'm uploading it.
msg306538 - (view) Author: Per Fryking (Per Fryking) Date: 2017-11-20 13:05
Got the same issue with the 3.6 installer from

The thing is that I can't elevate the priviliges to be administrator. So I'm stuck.

Uploading the log. Running windows 7
msg306626 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2017-11-21 04:10
> Got the same issue with the 3.6 installer

You've got a different issue, but I can't tell what it is without all of the logs. Can you look in your %TEMP% directory for the file you attached, and then also include those with the same prefix?
Date User Action Args
2022-04-11 14:58:21adminsetgithub: 69331
2017-11-21 04:14:42fovsetnosy: - fov
2017-11-21 04:10:49steve.dowersetmessages: + msg306626
2017-11-20 13:05:58Per Frykingsetfiles: + Python 3.6.3 (32-bit)_20171120135800.log
nosy: + Per Fryking
messages: + msg306538

2017-08-16 06:04:32Yu Zhigangsetfiles: + python install

messages: + msg300328
2017-08-15 15:23:12steve.dowersetmessages: + msg300299
2017-08-15 09:32:03Yu Zhigangsetnosy: + Yu Zhigang
messages: + msg300290
2016-09-09 23:40:57steve.dowersetstatus: open -> closed
versions: + Python 3.6
messages: + msg275497

resolution: fixed
stage: resolved
2016-09-09 23:39:59python-devsetnosy: + python-dev
messages: + msg275496
2016-08-19 12:49:28basuj81setnosy: + basuj81
messages: + msg273115
2016-07-14 15:57:38OBSOLETEsetnosy: + OBSOLETE
messages: + msg270418
2016-03-03 00:06:51Claudesetnosy: + Claude
messages: + msg261144
2015-12-11 19:08:25steve.dowersetmessages: + msg256227
2015-12-11 18:38:35ivan.radicsetnosy: + ivan.radic
messages: + msg256226
2015-12-03 13:26:37cbj4074setnosy: + cbj4074
messages: + msg255817
2015-10-30 18:32:43WadeHsettype: behavior ->

messages: + msg253751
nosy: + WadeH
2015-10-30 16:46:36lacsetnosy: + lac
messages: + msg253747
2015-10-30 15:26:17steve.dowersetmessages: + msg253738
2015-10-30 14:46:29maubpsetnosy: + maubp
messages: + msg253734
2015-09-23 01:00:46steve.dowersetassignee: steve.dower
messages: + msg251375
2015-09-17 13:45:35fovsetfiles: + Python 3.5.0 (32-bit)_20150916132422.log
2015-09-17 00:04:46terry.reedysetnosy: + paul.moore, tim.golden, zach.ware, steve.dower
2015-09-16 17:35:32fovcreate