1

I'm trying to install twarc2 in my conda environment (from here) :

conda install -c brown-data-science twarc 

The above command runs fine, if I try it again I get All requested packages already installed.

However when I try to import the module in python:

>>> import twarc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'twarc'

What am I missing?

Erwan
  • 1,385
  • 1
  • 12
  • 22

2 Answers2

1

The package is now available through Conda Forge.

conda create -n twarc -c conda-forge python=3.10 twarc

This provides v2.12.0 of the PyPI package, which includes both twarc and twarc2 entrypoints.

merv
  • 67,214
  • 13
  • 180
  • 245
0

I didn't pay attention to the fact that the version of twarc from anaconda that I was installing is only for python2 (and not twarc2). As a result it was installed for python2, and I was trying to import the module in python3.

The correct way to install twarc2 in a conda environment is as follows:

conda create -n twarc2 python=3.10
conda activate twarc2
pip install --upgrade twarc
Erwan
  • 1,385
  • 1
  • 12
  • 22