SeleniumBase/help_docs/install_python_pip_git.md

59 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2022-11-05 13:27:22 +08:00
<!-- SeleniumBase Docs -->
## Installation instructions for ``Git``, ``Python``, and ``pip``
2019-04-14 17:05:21 +08:00
### [Git](http://www.git-scm.com)
You can [download Git from here](http://git-scm.com/downloads).
2019-04-16 15:09:33 +08:00
(<i>A Git GUI tool like [SourceTree](https://www.sourcetreeapp.com/) or [GitHub Desktop](https://desktop.github.com/) can help you with Git commands.</i>)
(You can also download SeleniumBase from GitHub without using git-related commands.)
2020-09-18 02:19:21 +08:00
### [Python](https://www.python.org)
2019-06-11 11:11:44 +08:00
You can download Python from [https://www.python.org/downloads/](https://www.python.org/downloads/) if it's not already preinstalled on your machine.
2022-11-05 13:27:22 +08:00
### [pip](https://en.wikipedia.org/wiki/Pip_%28package_manager%29)
2019-06-11 11:11:44 +08:00
2022-11-05 13:27:22 +08:00
**``pip`` already comes with Python!** (It lets you install packages, such as ``seleniumbase``.)
2019-06-11 11:11:44 +08:00
2022-11-05 13:27:22 +08:00
⚠️ If something went wrong with your ``pip`` installation, try this:
2021-10-09 11:58:31 +08:00
2016-02-17 09:35:18 +08:00
```bash
python -m ensurepip --default-pip
2017-03-10 12:54:05 +08:00
```
If your existing version of pip is old, upgrade to the latest version:
2021-10-09 11:58:31 +08:00
2018-02-14 05:03:36 +08:00
```bash
python -m pip install --upgrade pip setuptools
2018-02-14 05:03:36 +08:00
```
On CentOS 7 and some versions of Linux, you may need to install pip with ``yum``:
2021-10-09 11:58:31 +08:00
2018-03-09 08:55:18 +08:00
```bash
yum -y update
yum -y install python-pip
2018-03-09 08:55:18 +08:00
```
2021-10-09 11:58:31 +08:00
If you're having any trouble getting pip, you can [GET PIP HERE](https://pip.pypa.io/en/latest/installation/).
2017-03-10 12:54:05 +08:00
2020-09-18 02:19:21 +08:00
When done, make sure the location of pip is on your path, which is ``$PATH`` for macOS/Linux. (On Windows, it's the System Variables ``Path`` within System Environment Variables.)
2018-09-29 06:42:45 +08:00
You can also get pip (or fix pip) by using:
2021-10-09 11:58:31 +08:00
2018-09-29 06:42:45 +08:00
```bash
curl https://bootstrap.pypa.io/get-pip.py | python
```
2021-10-09 11:58:31 +08:00
2019-04-16 15:09:33 +08:00
* (If you get SSL errors while trying to install packages with pip, see [this Stackoverflow post](https://stackoverflow.com/questions/49768770/not-able-to-install-python-packages-ssl-tlsv1-alert-protocol-version), which tells you to run the above command.)
2018-09-29 06:42:45 +08:00
2019-04-16 15:09:33 +08:00
**Keep Pip and Setuptools up-to-date:**
2021-10-09 11:58:31 +08:00
```bash
2019-04-16 15:09:33 +08:00
python -m pip install -U pip setuptools
```
2021-10-09 11:58:31 +08:00
2019-04-16 15:09:33 +08:00
* (Depending on your user permissions, you may need to add ``--user`` to the command if you're not inside a [Python virtual environment](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md), or use "[sudo](https://en.wikipedia.org/wiki/Sudo)" on a UNIX-based OS if you're getting errors during installation.)