I can download python 2.7.12 from python.org, and all python versions from 2.7.9 onwards are supposed to come with pip, but after installing it, using pip in the terminal does not work. I am on macOS. Have I installed pip, and if I have, how do I use it?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Here you have informations about pip:
https://packaging.python.org/installing/
normally python from python.org come with pip, maybe you should just update... to update from terminal:
pip install -U pip setuptools
After when you need to install package, for example
numpy
, just do in a terminal:pip install numpy
more informations here :
https://pip.pypa.io/en/stable/reference/pip_install/
you can also use
conda install
from anaconda as an alternative ofpip
:http://conda.pydata.org/docs/get-started.html
Multiple instances of Python can coexist on your machine. Thus you could have installed Python 2.7.12 yet, when you call Python from terminal, you may be calling an older version.
To know which version you are using, type
which python
in terminal and look at its path. Then from Python in terminal, typeto get the exact version. As Dadep says, I would recommend using
conda
to isolate your invironments if you have to play with multiple Python interpreters. Further conda simplifies 3rd party package installation process beyond doubt.