I'm trying to run DrQa form facebook research, available at https://github.com/facebookresearch/DrQA. One of the requirements is prettytable. I had problems installing it, and followed Can't install prettytable:
pip3 install https://pypi.python.org/packages/source/P/PrettyTable/prettytable-0.7.2.tar.bz2
Now I have the following:
$ ls -l /usr/lib/python3.5/site-packages
total 1896
drwxr-xr-x 2 root root 4096 Aug 10 17:04 prettytable-0.7.2.dist-info
-rwxr-xr-x 1 root root 54204 Aug 10 17:04 prettytable.py
drwxr-xr-x 22 root root 4096 Aug 10 17:04 scipy
drwxr-xr-x 2 root root 4096 Aug 10 17:04 scipy-0.19.1.dist-info
[truncated]
Trying to use it:
$ python3 scripts/pipeline/interactive.py
Traceback (most recent call last):
File "scripts/pipeline/interactive.py", line 12, in <module>
import prettytable
ImportError: No module named 'prettytable'
I have the feeling I still need to install the module (this is mentioned at the link, but I also get suspicious from scipy having no .py, while prettytable does), but I do not know how. Any tips?
Note: I have always used python2.7. This is the first time using python3, and the first time using a virtual environment. It is well possible that I made a mistake here.
Note2: I performed a chmod +x on prettytable.py, and also tried to run interactive.py with sudo, to check against permission problems.
You have omitted a lot of important information so I let me guess. You installed prettytable globally (before activating a virtual environment) but run python3 scripts/pipeline/interactive.py
after activating one, right?
Virtual environments are intended to separate groups of installed packages so by default global packages are not available in virtual environments. You have to install prettytable in the virtual environment:
source venv/bin/activate
pip install https://pypi.python.org/packages/source/P/PrettyTable/prettytable-0.7.2.tar.bz2
Or you have to recreate the virtual environment with option --system-site-packages
. Or use command toggleglobalsitepackages
from virtualenvwrapper
.