Requirement already satisfied:

在安装Python中的某个包时会遇到以下问题

C:\Users\DYY>pip install numpy
Requirement already satisfied: numpy in f:\software\lib\site-packages (1.16.5)

这就是你安装了Python解释器之后,再其他的地方安装Anaconda,然后它自带了numpy这个包。这个时候需要:

C:\Users\DYY\AppData\Local\Programs\Python\Python36-32\Scripts>pip install numpy
Collecting numpy
  Downloading https://files.pythonhosted.org/packages/d5/ae/926d83b4fd38cba6a8691c1368e0d9a1d0916c3e765161d58cd32bde1efb/numpy-1.18.1-cp36-cp36m-win32.whl (10.8MB)
    7% |██▌                             | 849kB 19kB/s eta 0:08:31

再你安装Python的指定目录下安装该包就可以。
安装前测试代码:

import numpy as np
a = np.arange[10]
print(a)


C:\Users\DYY\AppData\Local\Programs\Python\Python36-32\python.exe F:/Python_code/数据库编程/numpy/arrange.py
Traceback (most recent call last):
  File "F:/Python_code/数据库编程/numpy/arrange.py", line 2, in <module>
    a = np.arange[10]
AttributeError: module 'numpy' has no attribute 'arange'

Process finished with exit code 1

安装后代码执行:

C:\Users\DYY\AppData\Local\Programs\Python\Python36-32\python.exe F:/Python_code/数据库编程/numpy/arrange.py
[0 1 2 3 4 5 6 7 8 9]

Process finished with exit code 0

你可能感兴趣的:(python学习,安装包,python报错)