轉載-不安裝vc2015 Redistributable解決api-ms-win-crt-runtime-l1-1-0.dll丟失錯誤

來源:互聯網
上載者:User

標籤:system   rar   出錯   syn   檔案   遇到   baidu   func   ima   

一、背景

最近用到python下的cx_Oracle模組,開發環境中測試正常,用cx_freeze打包後,到使用者機器上一部署,各種奇奇怪怪的問題頻出,運行環境如下:

a、開發環境:64位win10作業系統,安裝32位python,32位oracle client,32位firefox。

b、生產環境:64位win7作業系統,64位win8作業系統,32位win7作業系統,32位win8作業系統……比較複雜,各種情況都有。

問題主要有兩個:1、python經典的中文字元問題,2、vc2015依賴問題,這裡重點說下vc2015依賴問題。

錯誤資訊如下,提示api-ms-win-crt-runtime-l1-1-0.dll缺失。

 

二、原因分析

原因很簡單,cx_oracle是在vc2015下編譯的,所以運行cx_oracle.pyd需要vc2015運行環境。

百度了一下,發現問題非常普遍,解決方案大同小異(其中又以這個地址的資訊最準確全面,http://blog.csdn.net/huqiao1206/article/details/50768481)

總的來說整個過程非常耗時,堪稱現實版“多米諾骨牌效應”,為了一個vc2015運行環境,就差沒把作業系統的重裝。

具體處理過程如下,與文章中基本一致。

1、安裝vc2015 發行包,最後出錯,提示需要先安裝KB2999226 補丁。

2、安裝KB2999226補丁,又提示需要安裝win7 sp1(後來發現win8系統,也有同樣問題)。

3、安裝win7 sp1時,由於機器長期未正常開啟update,安裝sp1的時候,又遇到一個新的錯誤,各種補丁。

 

 

三、新的解決方案

前述是常規解決方案,慶幸的是經過多方搜尋和反覆嘗試,最終找到了新的解決方案,思路如下:

1、到正常的機器,或者就在開發環境,去搜尋api-ms-win-crt-runtime-l1-1-0.dll檔案。

結果在C:\windows\system32,以及C:\Windows\SysWOW64,以及C:\Program Files (x86)\Mozilla Firefox中都找到了該檔案。

三個目錄下都有,到底選哪個呢?涉及到一個新的64位系統32位dll的問題。我參考了這篇文章,https://jingyan.baidu.com/article/454316ab73ce1ef7a7c03a01.html

規則如下:

a、64位作業系統,32位程式,選擇syswow64下dll

b、64位作業系統,64位程式,選擇system32下dll

c、32位作業系統,32位程式,選擇system32下dll

2、拷貝所有api-ms開頭的dll ,以及msvcp140.dll,vcruntime140.dll,ucrtbase.dll到程式目錄。

一共44個檔案。

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 磁碟機 D 中的卷是 新加卷 卷的序號是  D:\python 的目錄 2017/03/24  02:06            18,624 api-ms-win-core-console-l1-1-0.dll2017/03/24  02:06            17,600 api-ms-win-core-datetime-l1-1-0.dll2017/03/24  02:06            17,600 api-ms-win-core-debug-l1-1-0.dll2017/03/24  02:06            18,104 api-ms-win-core-errorhandling-l1-1-0.dll2017/03/24  02:06            21,696 api-ms-win-core-file-l1-1-0.dll2017/03/24  02:06            18,112 api-ms-win-core-file-l1-2-0.dll2017/03/24  02:06            18,112 api-ms-win-core-file-l2-1-0.dll2017/03/24  02:06            18,112 api-ms-win-core-handle-l1-1-0.dll2017/03/24  02:06            18,112 api-ms-win-core-heap-l1-1-0.dll2017/03/24  02:06            18,104 api-ms-win-core-interlocked-l1-1-0.dll2017/03/24  02:06            18,624 api-ms-win-core-libraryloader-l1-1-0.dll2017/03/24  02:06            20,672 api-ms-win-core-localization-l1-2-0.dll2017/03/24  02:06            18,624 api-ms-win-core-memory-l1-1-0.dll2017/03/24  02:06            18,112 api-ms-win-core-namedpipe-l1-1-0.dll2017/03/24  02:06            19,136 api-ms-win-core-processenvironment-l1-1-0.dll2017/03/24  02:06            20,160 api-ms-win-core-processthreads-l1-1-0.dll2017/03/24  02:06            18,624 api-ms-win-core-processthreads-l1-1-1.dll2017/03/24  02:06            17,600 api-ms-win-core-profile-l1-1-0.dll2017/03/24  02:06            17,600 api-ms-win-core-rtlsupport-l1-1-0.dll2017/03/24  02:06            18,112 api-ms-win-core-string-l1-1-0.dll2017/03/24  02:06            20,160 api-ms-win-core-synch-l1-1-0.dll2017/03/24  02:06            18,624 api-ms-win-core-synch-l1-2-0.dll2017/03/24  02:06            19,136 api-ms-win-core-sysinfo-l1-1-0.dll2017/03/24  02:06            18,112 api-ms-win-core-timezone-l1-1-0.dll2017/03/24  02:06            18,112 api-ms-win-core-util-l1-1-0.dll2015/06/07  07:08            11,616 api-ms-win-core-xstate-l2-1-0.dll2017/03/24  02:06            19,136 api-ms-win-crt-conio-l1-1-0.dll2017/03/24  02:06            22,208 api-ms-win-crt-convert-l1-1-0.dll2017/03/24  02:06            18,624 api-ms-win-crt-environment-l1-1-0.dll2017/03/24  02:06            20,160 api-ms-win-crt-filesystem-l1-1-0.dll2017/03/24  02:06            18,624 api-ms-win-crt-heap-l1-1-0.dll2017/03/24  02:06            18,624 api-ms-win-crt-locale-l1-1-0.dll2017/03/24  02:06            28,864 api-ms-win-crt-math-l1-1-0.dll2017/03/24  02:06            25,792 api-ms-win-crt-multibyte-l1-1-0.dll2017/03/24  02:06            72,896 api-ms-win-crt-private-l1-1-0.dll2017/03/24  02:06            19,136 api-ms-win-crt-process-l1-1-0.dll2017/03/24  02:06            22,720 api-ms-win-crt-runtime-l1-1-0.dll2017/03/24  02:06            24,256 api-ms-win-crt-stdio-l1-1-0.dll2017/03/24  02:06            24,256 api-ms-win-crt-string-l1-1-0.dll2017/03/24  02:06            20,672 api-ms-win-crt-time-l1-1-0.dll2017/03/24  02:06            18,624 api-ms-win-crt-utility-l1-1-0.dll2015/06/07  07:08            11,616 api-ms-win-eventing-provider-l1-1-0.dll2017/03/24  02:06           440,120 msvcp140.dll2017/03/24  02:06           917,184 ucrtbase.dll2017/03/24  02:06            83,784 vcruntime140.dll              44 個檔案     37,191,043 位元組               0 個目錄  8,842,960,896 可用位元組

 

至此,成功解決api-runtime確實錯誤,無需安裝vc2015 runtime ,也就無需升級sp1。

總結:

1、最開始的啟發其實來自於搜尋,偶然搜尋到的firefox目錄,發現一系列api開頭的檔案。

2、膽大心細,反覆嘗試,最開始走了很多彎路,包括什麼註冊dll之類,其實都是錯誤的,關鍵是在ucrtbase.dll檔案必須有。

<--end-->

轉載-不安裝vc2015 Redistributable解決api-ms-win-crt-runtime-l1-1-0.dll丟失錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.