Installation¶
This page contains installation information and links about installing Tweezepy.
Prerequisite: Python¶
Tweezepy requires a working Python installation (Python 3.3 or greater). If you do not have a working installation, you will need to download and install one.
For new users, we recommend using the Anaconda distribution to install Python and Jupyter. Anaconda conveniently installs Python, Jupyter, and other commonly used packages for scientific computing and data science.
To install Python via Anaconda, use the following installation steps:
Download Anaconda. We recommend downloading Anaconda’s latest Python 3 version (currently Python 3.8).
Install the version of Anaconda which you downloaded, following the instructions on the download page.
Congratulations, you have installed Python.
Alternative Python installation:¶
If you do not want to install Python via the Anaconda distribution, there are a number of other ways to install Python. For example, you can install it via the official distribution.
Currently, Python 3.10.x is incompatible with many standard scientific computing packages, including those used by Tweezepy. You should install the latest version of 3.9.x. until further notice.
If you install Python separately, you may need to install some additional packages. If you follow this guide, these additional packages should be installed automatically. They are also listed in the requirements.txt file.
Ensure you can run Python¶
Once you install Python, you can access the Python intepreter by going to the command prompt and typing
python
To exit the Python interpreter, type
quit()
You can check the installed Python version by typing
python --version
If everything is installed correctly, you should get an output like this Python 3.8.x.
Installing Tweezepy¶
The recommended way to install Tweezepy is using pip, the package installer for Python, from the Python Package Index. Usually, pip comes pre-installed with Python.
To check whether you have pip installed, run the following commands from the command prompt.
pip --version
If pip is installed properly, you should get an output like pip 21.0.1 from ....
Once you’ve verified that you have a working Python installation with pip installed, you can run the following command from the command line to download and install Tweezepy:
python -m pip install tweezepy
Congratulations, you have now installed Tweezepy.
Installing from source¶
For advanced Python users who want the latest development version of Tweezepy, it can also be installed from source. To install from source, clone the source repository from Github:
git clone https://github.com/ianlmorgan/tweezepy.git
Once you’ve downloaded the source, you can navigate into the root source directory and run:
python -m pip install .
Running tests¶
If you installed from source, you should run the tests to make sure everything worked properly. From the root of the source directory, run:
python -m pip install -U pytest
python -m pytest -v tests
This will take a few seconds. You may get a few deprecation warnings, but you shouldn’t get any errors if all went as planned.
Optional: Jupyter notebooks¶
You can run Python code directly in the Python interpreter or as a script in an integrated development editor (IDE), such as Spyder, Visual Studio Code, or Sublime text.
Alternatively, it can be convenient to use Jupyter Notebooks, which is similar to the notebook format used by Mathematica.
If you installed Python via the Anaconda distribution, you should already have installed Jupyter. If you installed Python in a different way, you may need to install Jupyter separately. To install Jupyter via pip, type the following into the command prompt:
python -m pip install jupyter