This is just a small collection of common error messages and solutions that we encounter when using Python.
Python Troubleshooting Q&A
1. Pyfolio – AttributeError: ‘numpy.int64’ object has no attribute ‘to_pydatetime’
- # remove your installed pyfolio library
pip uninstall pyfolio
# Install it again from its github repo
pip install git+https://github.com/quantopian/pyfolio
2. For using git, add git path to the PATH on Windows
- Find Git executable file (git.exe) is located
in C:\Program Files\Git\bin
or C:\Program Files\Git\cmd
or other directories
The directory that is found must be added to the PATH environment variable and the version of Git needs to be confirmed as follows.
git version 2.35.4.windows.1
3. TabError: inconsistent use of tabs and spaces in indentation
- This problem occurs when we mix tabs and spaces in the same code block. To solve the error, remove the spacing and only use tabs or spaces, but don’t mix the two in the same code block.
4. Multiple prints in Jupyter notebook
5. ValueError: Please initialize `Bidirectional` layer with a `tf.keras.layers.Layer` instance.
Just delete tensorflow.
to be added….