[PYTHON] The story of sys.path.append ()
Book: Deep Learning from scratch (O'Reilly Japan) I stumbled a little when reading the mnist data on page 73, but it was resolved. I wrote down the solution.
The stumbled part
- Sys.path.append (os.pardir) * cannot import * mnist.py * when importing the folder one level above the first folder with * mnist.py *.
Solution
- It is assumed that you have already downloaded the repository file from github and unzipped it.
The current directory can be anywhere, and the * sys.path.append (os.pardir) * part should be * sys.path.append (absolute path) *.
Example: * sys.path.append (D: \ File \ deep-learning-from-scratch-master) *
Maybe this should work.