Installing TWINT on Windows 10

I ran into some trouble installing twint on a windows 10 machine recently. After a while I figured it out. This post will describe the steps I took to get twint working on a fresh and clean windows 10.

There are a few extra’s neccesary before we can install twint.

I installed Twint as follows:

First installing some software:
1) Install python 3.8.2

Check ‘add Python 3.8 to PATH’ and choose custom install

Check all options

check install for all users and leave the rest as it is
I choose a python directory like C:\Program Files\python\Python38
If you want to install another python version in the future, you can install it in the same main folder named python.

2) Install git bash 2.29.x

During installation at the 7th screen check the option “Git from the command line and also from 3rd-party software”. Leave the rest as it is.

Next thing is to check if git and python are installed correctly. In order to do that open a windows cmd prompt as administrator.

Then type in the command prompt:

python

If python was installed correctly it wil show somethin like this. I installed python 3.8.2 released on feb 25 2020. Then to leave python enter:

exit()

To check if git was properly installed type

git

You should see an message like this:

If you got an error like this

It means that git is not on the path variable. Add it to the path variable:

Select path at the system variables and click edit. Add the next line to the entry and click ok.

C:\Program Files\Git\cmd

3) Install tools for visual studio

Then install the tools for visual studio.

Select the C++ build tools (1) and the (2) MSVC v140 — VS 2015 C++ buildtools (v14.00). This can take a while since it’s +5Gb.
After install you MUST REBOOT

4) Numpy

Numpy can give some errors so i downloaded a numpy library from a secondary library party: https://download.lfd.uci.edu/pythonlibs/z4tqcw5k/numpy-1.19.4+mkl-cp38-cp38-win_amd64.whl Save it for example in the folder you are going to use for the installation of twint. In my case:

Again open a windows command prompt as administrator and cd to your numpy file:

Then execute the following command (1) if you already had numpy installed otherwise execute (2) the second series of commands. This will update your pip installer and then install the downloaded whl package.

# (1) if numpy was already installed, uninstall it
pip uninstall numpy
# (2) enter the following code:
python -m pip install --upgrade pip
pip install “numpy-1.19.4+mkl-cp38-cp38-win_amd64.whl”

5) Install pycares.

Pycares is another library that gave me some trouble. So I installed pycares also seperatly.

open (windows prompt and not powershell) cmd as admin
python -m pip install --upgrade pip
pip install pycares==3.1.1

The above figure shows that the librarys are installed successfully.

6) Install twint

Follow the commands.

python -m venv twint_env
twint_env\scripts\activate.bat
python -m pip install --upgrade pip
pip install pycares==3.1.1
pip install pandas==1.1.5
pip install “numpy-1.19.4+mkl-cp38-cp38-win_amd64.whl”
python -m pip install pip==19.0.3
pip install setuptools==40.8.0
pip install --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint

In the end you should see something like the figure as below:

7) Using twint.
Printing output will give sometimes an error then use -ho to hideout the output text to the terminal.

twint -u bearhunt11 -o file.csv --csv -ho

8) Turn off virtual environment

deactivate

That’s it. If it worked for you, please give a thumbs up.

Conclusion

Use Linux thats quicker :)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store