python2没有pip命令_python 2.7:无法在Windows上pip“ bash:pip:命令未找到”

I am trying to install the SciPy stack located at https://scipy.org/stackspec.html [I am only allowed 2 links; trying to use them wisely]. I realize that there are much easier ways to do this, but I think there is a lot to be learned by doing it manually. I am relatively new to a lot of this stuff, so I apologize if I sound ignorant at any point.

I am running Windows 7 Enterprise - 64 bit. Here is what I have done so far:

Installed numpy-1.8.1-win32-superpack-python2.7 from

http://sourceforge.net/projects/numpy/files/

Test: import numpy as np ---> no errors

Installed scipy library,

scipy-0.14.0-win32-superpack-python2.7.exe from

(SCIPY DOT ORG LINK REMOVED)

Test: import scipy as sp ---> no errors

Installed matplotlib: matplotlib-1.3.1.win32-py2.7.exe from

(MATPLOTLIB DOT ORG LINK REMOVED)

Installed PIP by running script here:

https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py

I just copied-pasted script to a new file in IDLE,

saved as C:\Python27\Scripts\pip_install.py and clicked Run>module. No errors reported.

Does the path on which I saved

pip_install.py matter?

6.

HERE IS WHERE I FAIL

Attempted to install matlibplot dependency dateutil: Opened a

Cygwin Shell, and typed

cd C:\Python27 ! is it necessary to cd to python directtory?

pip install python-dateutil

This results in the error:

bash: pip: command not found

I get the same error attempting from cmd.

Any help is appreciated; the closest I found was bash: pip: command not found. But the OSX nature of it is just enough to confise me further.

UPADTE:

I added the pip-path per Paul H's suggestion below. It made the error go away, but strangely, nothing I pip actually installs. For example, in Cygwin, I type:

cbennett2> pip install python-dateutil

cbennett2>

You can see that there is no output or feedback from the shell (which I think there should be). Then when I go to a new python shell:

>>> from dateutil.parser import parse

Traceback (most recent call last):

File "", line 1, in

from dateutil.parser import parse

ImportError: No module named dateutil.parser

>>>>

This happens with all of the modules that I thought I had pip'd ... pandas, tornado, etc.

解决方案

On Windows, pip lives in C:\[pythondir]\scripts.

So you'll need to add that to your system path in order to run it from the command prompt. You could alternatively cd into that directory each time, but that's a hassle.

See the top answer here for info on how to do that:

Adding Python Path on Windows 7

Also, that is a terrifying way to install pip. Grab it from Christophe Gohlke. Grab everything else from there for that matter.

http://www.lfd.uci.edu/~gohlke/pythonlibs/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值