zoukankan      html  css  js  c++  java
  • python模块安装

    现在终于知道怎么在windows上导入Python的第三方模块了

    首先在DOS下进入Python安装的pip目录:D:/Python27/Scripts(即pip.exe的目录)

    用pip install XXX安装

    之前一直都是直接用模块名安装,结果发现有时很慢。。。并且有些模块还很难直接安装,后来找到了一个新的途径,就是安装whl文件

    Python的第三方whl文件可以在这里找到http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

    例如你要安装numpy模块,首先从网站中下载numpy-1.13.1+mkl-cp27-cp27m-win_amd64.whl文件(名称编号:前面的模块名,cp27代表Python版本,amd64代表64bit系统)

    将下载的文件放在D:/Python27/Lib/site-packages便于管理,install完之后可以删掉

    安装方法:pip install +whl的路径

    例如安装scipy: pip install D:/Python27/Lib/site-packages/scipy-0.19.1-cp27-cp27m-win_amd64.whl 就ok了

    机器学习scikit-learn的安装顺序:

    依次安装numpy+MKL→scipy→matplotlib→scikit-learn

    pip install +模块名 常出错的解决办法:

    1.如果出现以下错误:

    EnvironmentError: [Errno 13] Permission denied:
    Could not install packages due to anEnvironmentError: [Errno 13] Permission denied:'C:\ProgramData\Anaconda3\Lib\site-packages\ipykernel_launcher.py'
    Consider using the `--user` option or checkthe permissions.  

    解决办法:

    这时,你需要把有python的进程关掉,然后再次执行。 

    2. 如果出现以下错误:

    Cannot uninstall ‘six’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

    则可以采用这个命令,即可解决:

    sudo pip install tensorflow –ignore-installed six                                                                                                                                                          

  • 相关阅读:
    【分治】动态点分治 ([ZJOI2007]捉迷藏)
    【图论】Tarjan 割点(割顶)
    selenium (五) ActionChains
    selenium (四) WebDriverWait 与 expected_conditions
    selenium (三) 下拉框选项操作
    selenium (二) 浏览器的基本操作
    selenium (一) webdriver 元素定位方法
    selenium 常见问题
    locust 实战:完成用户登录并下单的流程
    MyEclipse 工具过期后,重新激活方法
  • 原文地址:https://www.cnblogs.com/chaofn/p/7461775.html
Copyright © 2011-2022 走看看