“no module named PyPDF2” error
In my case, I was trying to import ‘pyPdf2’ instead of ‘PyPDF2’. Observe the case. import PyPDF2 is correct.
In my case, I was trying to import ‘pyPdf2’ instead of ‘PyPDF2’. Observe the case. import PyPDF2 is correct.
Change: from collections import Mapping to from collections.abc import Mapping
Python adds the directory where the initial script resides as first item to sys.path: As initialized upon program startup, the first item of this list, path[0], is the directory containing the script that was used to invoke the Python interpreter. If the script directory is not available (e.g. if the interpreter is invoked interactively or … Read more
There is no way to tell Sphinx to exclude some imports. When using autodoc, all documented modules must be cleanly importable. You might be able to work around the problem by doing some mocking. Here is an article describing the solution to a problem that seems quite similar to yours: http://blog.rtwilson.com/how-to-make-your-sphinx-documentation-compile-with-readthedocs-when-youre-using-numpy-and-scipy/. Here is a small … Read more
pylab requires pytz. The easiest way to install a package in Python is to run pip install pytz. Today, Python comes with pip pre-installed, but use these instructions if you need to install it: Installation: Do I need to install pip?
Your PYTHONPATH is set to the parent directory of the executed script. So if the executed script is inside a directory src, it will never be able to find the sister directory lib because it isn’t within the path. There’s a few choices; Just move lib/ into src/ if it belongs to your code. If … Read more
Change: from collections import Mapping to from collections.abc import Mapping
The ImportError message is a bit misleading because of the reference to Win32, whereas the problem was simply the OpenCV DLLs were not found. This problem was solved by adding the path the OpenCV binaries to the Windows PATH environment variable (as an example, on my computer this path is: C:\opencv\build\bin\Release).
The “flask.ext” style of naming/importing modules has been deprecated since 2016. Here’s the reasoning. You should use the first style you described instead: # Use this import format from flask_sqlalchemy import SQLAlchemy As for the suggestion that you install your flask packages globally, this somewhat defeats the purpose of using a venv in the first … Read more
Eureka! I pulled my hair out for 2 days trying to get this to work. Enlightenment came from this SO Question. Simply stated, you probably installed psycopg2 x64 version like I did, not realizing your python version was 32-bit. Unistall your current psycopg2, then: Download: psycopg2-2.6.1.win32-py3.4-pg9.4.4-release.exe from HERE, then run the following in a Terminal: … Read more