安裝 SciPy 和 scikit-learn 升級pip 及pip基本命令表


  安裝Scipy和scikit-learn出錯,出錯記錄及當時最終解決辦法

問題:

 一、使用pip直接安裝

  直接pip install scipy  

C:\Users\Plain>pip install scripy
Collecting scripy
Downloading Scripy-0.9.3.tar.gz
Complete output from command python setup.py egg_info:Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\plain\appdata\local\temp\pip-build-bqakt2\scripy\setup.py",line 96, in <module>
description=get_description(packages[0], PACKAGE_DIR),
File "c:\users\plain\appdata\local\temp\pip-build-bqakt2\scripy\setup.py",line 47, in get_description
pkg = __import__(package, level=1)
File "c:\users\plain\appdata\local\temp\pip-build-bqakt2\scripy\lib\scripy\__init__.py", line 11, in <module>
from .edit import *
File "c:\users\plain\appdata\local\temp\pip-build-bqakt2\scripy\lib\scripy\edit.py", line 15, in <module>
import pwd
ImportError: No module named pwd

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\plain\appdata\local\temp\pip-build-bqakt2\scripy\

  顯示錯誤后,也沒有仔細分析問題原因,能力欠缺。

 

解決:

二、使用.whl文件安裝

  在網站下載scipy.whl 軟件http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

  然后在msdos中直接:pip install (將下載好的.whl文件拖入即可)

  安裝失敗:顯示:  

C:\Users\Plain>pip install C:\Users\Plain\Desktop\scipy-0.17.1-cp27-cp27m-win_amd64.whl
scipy-0.17.1-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.
You are using pip version 7.1.2, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

  在剛才下載的網上查閱了關於安裝有:Use pip version 8 or newer to install the downloaded .whl files.

  大意就是使用pip version 8 或者最新版本(我的是7.1.2,當時最新8.1.2),可能是pip過舊的原因

解決續:

三,升級pip,及部分pip命令學習

  按照上邊的升級提示:

  python -m pip install --update pip

  果然最后顯示:Successfully installed pip-8.1.2

  然后查看pip版本 使用pip -V

  如果命令出錯會顯示所有的pip 命令:

  

 1 C:\Users\Plain>pip -v
 2 
 3 Usage:
 4   pip <command> [options]
 5 
 6 Commands:
 7   install                     Install packages.
 8   download                    Download packages.
 9   uninstall                   Uninstall packages.
10   freeze                      Output installed packages in requirements format # 輸出已安裝的軟件包的需求格式
11   list                        List installed packages.     # 類似於freeze
12   show                        Show information about installed packages.
13   search                      Search PyPI for packages.
14   wheel                       Build wheels from your requirements.
15   hash                        Compute hashes of package archives.
16   completion                  A helper command used for command completion
17   help                        Show help for commands.
18 
19 General Options:
20   -h, --help                  Show help.
21   --isolated                  Run pip in an isolated mode, ignoring
22                               environment variables and user configuration.
23   -v, --verbose               Give more output. Option is additive, and can be
24                               used up to 3 times.
25   -V, --version               Show version and exit.
26   -q, --quiet                 Give less output.
27   --log <path>                Path to a verbose appending log.
28   --proxy <proxy>             Specify a proxy in the form
29                               [user:passwd@]proxy.server:port.
30   --retries <retries>         Maximum number of retries each connection should
31                               attempt (default 5 times).
32   --timeout <sec>             Set the socket timeout (default 15 seconds).
33   --exists-action <action>    Default action when a path already exists:
34                               (s)witch, (i)gnore, (w)ipe, (b)ackup.
35   --trusted-host <hostname>   Mark this host as trusted, even though it does
36                               not have valid or any HTTPS.
37   --cert <path>               Path to alternate CA bundle.
38   --client-cert <path>        Path to SSL client certificate, a single file
39                               containing the private key and the certificate
40                               in PEM format.
41   --cache-dir <dir>           Store the cache data in <dir>.
42   --no-cache-dir              Disable the cache.
43   --disable-pip-version-check
44                               Don't periodically check PyPI to determine
45                               whether a new version of pip is available for
46                               download. Implied with --no-index.
47 
48 C:\Users\Plain>pip -V
49 pip 8.1.2 from c:\python27\lib\site-packages (python 2.7)

 

四、直接使用pip需要將pip添加到系統環境變量path中

 

 

----------------2016-7-24 12:29:40--

    source:


免責聲明!

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



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