PyPDF2 won't import

只愿长相守 提交于 2019-12-01 18:59:54

PyPDF2 is compatible with Python 3.4, so that's not the problem.

In which Python version do you have pip installed? Even though you're on python34, if pip is installed to a different version it will download libraries to that version.

In any case, you can always install by downloading from PyPI, then running setup.py install.

Still, the only possible explanation I have is that the current Python version you're on does not have PyPDF2 installed. See if you can import PyPDF2 from any of the other versions.

You can install PyPDF2 by using the following command,

pip install PyPDF2

In my case: pip3 install PyPDF2 with python in /usr/local/bin

[tim@axelrod utils] (hotfix/2.3.2)$ ls -l /usr/local/bin/python*
lrwxr-xr-x  1 root  admin    22 10 May  2017 /usr/local/bin/python -> /usr/local/bin/python3
lrwxr-xr-x  1 tim   admin    35  3 May  2017 /usr/local/bin/python3 -> ../Cellar/python3/3.6.1/bin/python3
lrwxr-xr-x  1 tim   admin    42  3 May  2017 /usr/local/bin/python3-config -> ../Cellar/python3/3.6.1/bin/python3-config
lrwxr-xr-x  1 tim   admin    37  3 May  2017 /usr/local/bin/python3.6 -> ../Cellar/python3/3.6.1/bin/python3.6
lrwxr-xr-x  1 tim   admin    44  3 May  2017 /usr/local/bin/python3.6-config -> ../Cellar/python3/3.6.1/bin/python3.6-config
lrwxr-xr-x  1 tim   admin    38  3 May  2017 /usr/local/bin/python3.6m -> ../Cellar/python3/3.6.1/bin/python3.6m
lrwxr-xr-x  1 tim   admin    45  3 May  2017 /usr/local/bin/python3.6m-config -> ../Cellar/python3/3.6.1/bin/python3.6m-config
-rwxr-xr-x  1 tim   wheel  4119  7 Jan  2012 /usr/local/bin/python_count
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!