You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I download the whole repo to folder c:\data-science-from-scratch on Windows.
There is the following code in chapter "statistics" from scratch.linear_algebra import sum_of_squares
In anaconda prompt I execute :
(dsfs) c:\data-science-from-scratch>python scratch\statistics.py
Traceback (most recent call last):
File "scratch\statistics.py", line 98, in
from scratch.linear_algebra import sum_of_squares
ModuleNotFoundError: No module named 'scratch'
Do you have some idea to solve the problem ?
The text was updated successfully, but these errors were encountered:
emmanuel59
changed the title
how do I install the linear_algebra library?
ModuleNotFoundError: No module named 'scratch'
May 2, 2023
Hi emmanuel. I hope this answer is not too late for you and can somehow help you.
The issue arises since scratch is expected to be a module available but cannot be found by the python interpreter. scratch module corresponds to "scratch" folder provided with this repository, and linear_algebra.py is located.
Note: In my case I am not using anaconda but my own virtual environment.
I have this folder structure:
my_workspace
|_ my_venv
|_ scratch (containing all .py files, including linear_algebra.py and init.py, which are relevant here)
I run the following lines from my terminal (I am on Windows, but should work for Linux/MacOS too) in order to make the script work: cd my_workspace my_venv\Scripts\activate set PYTHONPATH=./scratch # For windows export PYTHONPATH=./scratch # For mac/linux python3 scratch\ch8_2.py # It should work now
I've got your book and I'm working through it.
I download the whole repo to folder c:\data-science-from-scratch on Windows.
There is the following code in chapter "statistics"
from scratch.linear_algebra import sum_of_squares
In anaconda prompt I execute :
(dsfs) c:\data-science-from-scratch>python scratch\statistics.py
Traceback (most recent call last):
File "scratch\statistics.py", line 98, in
from scratch.linear_algebra import sum_of_squares
ModuleNotFoundError: No module named 'scratch'
Do you have some idea to solve the problem ?
The text was updated successfully, but these errors were encountered: