Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run pre_install #621

Closed
2 tasks done
Scoodood opened this issue Jan 7, 2023 · 10 comments · Fixed by #622
Closed
2 tasks done

Failed to run pre_install #621

Scoodood opened this issue Jan 7, 2023 · 10 comments · Fixed by #622
Labels
locked [bot] locked due to inactivity source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type

Comments

@Scoodood
Copy link

Scoodood commented Jan 7, 2023

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

I downloaded miniconda3 for Python3.9 and Python3.10 from here. First, I uninstalled and deleted all my previous anaconda or miniconda folders and rebooted my PC before installing the new miniconda.

During the installation, I got the "Failed to run pre_install" error, as shown in the screenshot below. Both Python3.9 and 3.10 installations gave me the same error. I also tried to "Run as Administrator" but still got the same error. Does anyone have a similar issue?

abc

I had to click "Ignore" to finish the installation. Is this a bug?

Conda Info

active environment : base
    active env location : C:\Users\xxxx\miniconda3
            shell level : 1
       user config file : C:\Users\xxxx\.condarc
 populated config files : C:\Users\xxxx\.condarc
          conda version : 22.11.1
    conda-build version : not installed
         python version : 3.10.8.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=11.6=0
                          __win=0=0
       base environment : C:\Users\xxxx\miniconda3  (writable)
      conda av data dir : C:\Users\xxxx\miniconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\xxxx\miniconda3\pkgs
                          C:\Users\xxxx\.conda\pkgs
                          C:\Users\xxxx\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\xxxx\miniconda3\envs
                          C:\Users\xxxx\.conda\envs
                          C:\Users\xxxx\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/22.11.1 requests/2.28.1 CPython/3.10.8 Windows/10 Windows/10.0.22621
          administrator : False
             netrc file : None
           offline mode : False

Conda Config

==> C:\Users\xxxx\.condarc <==
report_errors: True

Conda list

# Name                    Version                   Build  Channel
brotlipy                  0.7.0           py310h2bbff1b_1002    defaults
bzip2                     1.0.8                he774522_0    defaults
ca-certificates           2022.10.11           haa95532_0    defaults
certifi                   2022.12.7       py310haa95532_0    defaults
cffi                      1.15.1          py310h2bbff1b_3    defaults
charset-normalizer        2.0.4              pyhd3eb1b0_0    defaults
colorama                  0.4.6           py310haa95532_0    defaults
conda                     22.11.1         py310haa95532_4    defaults
conda-content-trust       0.1.3           py310haa95532_0    defaults
conda-package-handling    2.0.2           py310haa95532_0    defaults
conda-package-streaming   0.7.0           py310haa95532_0    defaults
console_shortcut_miniconda 0.1.1                haa95532_0    defaults
cryptography              38.0.1          py310h21b164f_0    defaults
idna                      3.4             py310haa95532_0    defaults
libffi                    3.4.2                hd77b12b_6    defaults
menuinst                  1.4.19          py310h59b6b97_0    defaults
openssl                   1.1.1s               h2bbff1b_0    defaults
pip                       22.3.1          py310haa95532_0    defaults
pluggy                    1.0.0           py310haa95532_1    defaults
powershell_shortcut_miniconda 0.0.1                haa95532_0    defaults
pycosat                   0.6.4           py310h2bbff1b_0    defaults
pycparser                 2.21               pyhd3eb1b0_0    defaults
pyopenssl                 22.0.0             pyhd3eb1b0_0    defaults
pysocks                   1.7.1           py310haa95532_0    defaults
python                    3.10.8               h966fe2a_1    defaults
requests                  2.28.1          py310haa95532_0    defaults
ruamel.yaml               0.17.21         py310h2bbff1b_0    defaults
ruamel.yaml.clib          0.2.6           py310h2bbff1b_1    defaults
setuptools                65.5.0          py310haa95532_0    defaults
six                       1.16.0             pyhd3eb1b0_1    defaults
sqlite                    3.40.0               h2bbff1b_0    defaults
tk                        8.6.12               h2bbff1b_0    defaults
toolz                     0.12.0          py310haa95532_0    defaults
tqdm                      4.64.1          py310haa95532_0    defaults
tzdata                    2022g                h04d1e81_0    defaults
urllib3                   1.26.13         py310haa95532_0    defaults
vc                        14.2                 h21ff451_1    defaults
vs2015_runtime            14.27.29016          h5e58377_2    defaults
wheel                     0.37.1             pyhd3eb1b0_0    defaults
win_inet_pton             1.1.0           py310haa95532_0    defaults
wincertstore              0.2             py310haa95532_2    defaults
xz                        5.2.8                h8cc25b3_0    defaults
zlib                      1.2.13               h8cc25b3_0    defaults
zstandard                 0.18.0          py310h2bbff1b_0    defaults

Additional Context

No response

@Scoodood Scoodood added the type::bug describes erroneous operation, use severity::* to classify the type label Jan 7, 2023
@AshutoshDongare
Copy link

I also encountered the same issue on clean installation of Miniconda latest version available as of today. I have Win 11 updated OS.

@davbeek
Copy link

davbeek commented Jan 14, 2023

Same here: Windows 10 Pro, version 21H2.

Wanted to upgrade from miniconda3 with an old Python interpreter to the new version. First, uninstalled conda via Uninstall-Miniconda3.exe and restarted windows, then downloaded and installed the new miniconda3 64 bit for Windows via Latest - Conda 22.11.1 Python 3.10.8 released December 22, 2022.

No problems installing this new version on my Mac.

@Scoodood
Copy link
Author

Scoodood commented Jan 15, 2023

I had tried out many combinations, such as uninstalling suspicious Apps, Windows Updates, ...etc. But none of them worked.

So I end up reinstalling Windows 11 Pro from ground up. Then it works. The miniconda, NodeJS (npm, node), Jupyter build...etc all installed and run without issue now. So I guess something must be corrupted somewhere before the resetting. I am glad that it works now.

@travishathaway travishathaway added the source::community catch-all for issues filed by community members label Jan 20, 2023
@jaimergp jaimergp transferred this issue from conda/conda Jan 20, 2023
@jaimergp
Copy link
Contributor

I think in this case this is just an overly alarming error (that pre-install script should be a dummy one, empty), but let's see why it's failing to run. You can "ignore" it and it should just work ok. @dbast can you confirm there are no pre-install scripts in the latest Miniconda?

Now, if you can check this: Did you delete the pkgs directory inside your installation? If it's still there, do you have a pkgs\pre_install.bat script there? Could you share the contents? Thanks!

@jaimergp
Copy link
Contributor

jaimergp commented Jan 20, 2023

We might have been a bit too optimistic on this bit :D

IfFileExists "$INSTDIR\pkgs\pre_install.bat" 0 NoPreInstall
DetailPrint "Running pre_install scripts..."
# At this point we don't have Python available yet, so we can't use the cmd wrapper
# _nsis.py as we do with post_install and pre_uninstall. We'll have to trust the
# system is well configured (CMD in patch, COMSPEC defined, etc.)
push '"$INSTDIR\pkgs\pre_install.bat"'
push "Failed to run pre_install"
push 'WithLog'
call AbortRetryNSExecWait
NoPreInstall:

@dbast
Copy link
Member

dbast commented Jan 20, 2023

yes, there are no pre_install scripts in the current miniconda.

@jaimergp
Copy link
Contributor

Given that a full OS reinstall helps, we might be able to use CMD /D ... to avoid registry issues getting in the way, for better isolation.

What output do you get in a regular CMD when you type set? Redact as needed, I just want to check if there are weird env vars defined in your systems.

@jaimergp
Copy link
Contributor

I don't think we need the except clause here at all:

pre_dst = join(tmp_dir, 'pre_install.bat')
try:
shutil.copy(info['pre_install'], pre_dst)
except KeyError:
with open(pre_dst, 'w') as fo:
fo.write(":: this is an empty pre install .bat script\n")

@mzeidhassan
Copy link

mzeidhassan commented Jan 20, 2023

same is happening with Miniconda3-py39_22.11.1-1-Windows-x86_64.exe. Any solution yet?

OS: Windows 10

@jaimergp
Copy link
Contributor

What happens if you create a plain text file with notepad, with these contents:

:: this is an empty pre install .bat script

Save it as preinstall.bat anywhere and double click on it. Ideally, nothing should happen.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Jan 25, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants