Error in Preprocessing even for the demo code

I tried the demo code, Installed the requirements too.

Command used: onmt_preprocess -train_src data/src-train.txt -train_tgt data/tgt-train.txt -valid_src data/src-val.txt -valid_tgt data/tgt-val.txt -save_data data/demo

Traceback (most recent call last):
File “/home/rlabs/.local/lib/python3.6/site-packages/pkg_resources/init.py”, line 584, in _build_master
ws.require(requires)
File “/home/rlabs/.local/lib/python3.6/site-packages/pkg_resources/init.py”, line 901, in require
needed = self.resolve(parse_requirements(requirements))
File “/home/rlabs/.local/lib/python3.6/site-packages/pkg_resources/init.py”, line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (tqdm 4.41.1 (/home/rlabs/.local/lib/python3.6/site-packages), Requirement.parse(‘tqdm~=4.30.0’), {‘OpenNMT-py’})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/bin/onmt_preprocess”, line 6, in
from pkg_resources import load_entry_point
File “/home/rlabs/.local/lib/python3.6/site-packages/pkg_resources/init.py”, line 3252, in
@_call_aside
File “/home/rlabs/.local/lib/python3.6/site-packages/pkg_resources/init.py”, line 3236, in _call_aside
f(*args, **kwargs)
File “/home/rlabs/.local/lib/python3.6/site-packages/pkg_resources/init.py”, line 3265, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/home/rlabs/.local/lib/python3.6/site-packages/pkg_resources/init.py”, line 586, in _build_master
return cls._build_from_requirements(requires)
File “/home/rlabs/.local/lib/python3.6/site-packages/pkg_resources/init.py”, line 599, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File “/home/rlabs/.local/lib/python3.6/site-packages/pkg_resources/init.py”, line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (requests 2.18.4 (/usr/lib/python3/dist-packages), Requirement.parse(‘requests<3,>=2.21.0’), {‘tensorboard’})

This was flagged as resolved.

@Ravneet Can you post what you did to fix the issue? It could help others.

Please Use pip3 instead of pip everywhere. While instalation, training, etc.