1

when installing python using pyenv getting installing "doc" component MSI error. I know it's not the python version causing this as I have tried multiple python versions however, still getting errors do with MSI. The python version is compatible with pyenv and I have checked this using pyenv install --list.

Steps to reproduce the error

I have a PowerShell script to install the latest version of pyenv-win atm using (3.1.1) and add environment variables

pip install pyenv-win --target $HOME\\.pyenv --no-user --upgrade

#Adding PYENV, PYENV_HOME and PYENV_ROOT to your Environment Variables

[System.Environment]::SetEnvironmentVariable('PYENV',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
[System.Environment]::SetEnvironmentVariable('PYENV_ROOT',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
[System.Environment]::SetEnvironmentVariable('PYENV_HOME',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")

#Adding the following paths to your USER PATH variable in order to access the pyenv command

[System.Environment]::SetEnvironmentVariable('path', $env:USERPROFILE + "\.pyenv\pyenv-win\bin;" + $env:USERPROFILE + "\.pyenv\pyenv-win\shims;" + [System.Environment]::GetEnvironmentVariable('path', "User"),"User")

#check if pyenv installed 
& pyenv --version

I know that pyenv-win has been successfully installed as I get the current version 3.1.1 output to the terminal. I also double-check by running pyenv install --list which shows all compatible versions of python.

I have another PowerShell which installs python version and creates a virtual environment (snippet of powershell script )

& pyenv rehash
& pyenv update
& pyenv install 3.8.1
& pyenv local 3.8.1
& pyenv rehash

when running this script am getting the MSI error. Sometimes it lists different components missing for example error installing "dev_d or "doc" but always has something to do with MSI.

Things I have tried

  • run vs code in admin
  • try multiple python versions
5
  • Is $HOME defined? Commented Mar 22, 2023 at 17:03
  • @jdweng $HOME is already set. when I do the following command echo $HOME in PowerShell I get the correct path which I expect. Commented Mar 23, 2023 at 8:26
  • Are you installing for one user or all users? Are you installing AS Admin or using a user account. See following : addictivetips.com/windows-tips/… Commented Mar 23, 2023 at 9:25
  • @jdweng installing for one user am using a user account. So if I do echo $home in PowerShell I get C:\Users\muhammad.pathan Commented Mar 23, 2023 at 9:32
  • See following. There are a few different fixes that worked for different installers of py : github.com/pyenv-win/pyenv-win/issues/265?force_isolation=true Commented Mar 23, 2023 at 9:56

1 Answer 1

0

Update

Found a workaround for this issue (The error is caused due to user and system variables configured). What worked for me is to download pyenv through Chocolatey as it sets and configures your system and user variables automatically. After doing this when running the following PowerShell script, I could install Python 3.8.1 without any issues.

& pyenv rehash
& pyenv update
& pyenv install 3.8.1
& pyenv local 3.8.1
& pyenv rehash
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.