Anaconda3 安裝scrapy出現UnsatisfiableSpecifications解決方案


前言:裝東西真的看運氣,有時候自己環境對了,一下子就裝上去了。如果環境不對,各種意想不到的問題,百度的時候,還沒有一個准確答案,全靠自己摸着石頭過河,瞎搞,哈哈。

一.目標,anaconda安裝scrapy

二.問題

我用了三種方式裝scrapy,前2種都沒成功,最后一種終於成功。可以直接看第三種方法。

    1.我先用的Anaconda Navigator安裝scrapy,裝不上去,報錯。

 

    UnsatisfiableSpecifications error

    Cause

    Some conda package installation specifications are impossible to satisfy. For example, conda create -n tmp python=3 wxpython=3 produces an "Unsatisfiable Specifications" error because wxPython 3 depends on     Python 2.7, so the specification to install Python 3 conflicts with the specification to install wxPython 3.

    When an unsatisfiable request is made to conda, conda shows a message such as this one:

    The following specifications were found to be in conflict:     - python 3*     - wxpython 3* -> python 2.7*     Use "conda info <package>" to see the dependencies for each package. 

    This indicates that the specification to install wxpython 3 depends on installing Python 2.7, which conflicts with the specification to install python 3.

    

    對這個問題,百度了n久,並沒有滿意答案。

    2.cmd輸入conda install scrapy報錯

    輸入之后,也報錯。

    UnsatisfiableError: The following specifications were found to be in conflict:
    - conda[version='>=4.6.12']
    - scrapy
    Use "conda search <package> --info" to see the dependencies for each package.

    報錯,未解決。

    3.cmd輸入pip install scrapy成功

       步驟:1.先打開cmd,輸入pip install scrapy

          2.但是會報錯,報錯信息如下:

          building 'twisted.test.raiser' extension
          error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
          3.http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted 下載twisted對應版本的whl文件,cp后面是python版本,amd64代表64位,
          運行命令:pip install C:\Users\Twisted-18.7.0-cp37-cp37m-win_amd64.whl       其中install后面為下載的whl文件的完整路徑名

          4.安裝完成后,再次運行:pip install Scrapy即可成功。

三、安裝的時候最好添加清華鏡像源,不然可能會報HTTP之類的錯誤。

    添加源的方法:1.在cmd下面輸入 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

              繼續輸入conda config --set show_channel_urls yes

             2.到C:\Users\11590目錄下(1159是我的微軟賬戶名),找到.condarc文件,刪去default源。

              效果圖:

四、Anaconda重裝我也試過,直接裝也會出問題。

    1.最好在系統設置里面,程序與軟件選項中卸載

    

    2.重啟后,刪除C:\Users\11590目錄下(1159是我的微軟賬戶名)這個目錄下,

    

 

     3.最好換個文件夾重裝。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM