Skip to content

Errors in Task 0.5 due to dependency issues #39

@choo8

Description

@choo8

After running the following commands (following the the instructions in https://minitorch.github.io/):

>>> python -m pip install -r requirements.txt
>>> python -m pip install -r requirements.extra.txt
>>> python -m pip install -Ue .
>>> conda install llvmlite

I get the following output when I run pip freeze in my conda environment:

aiohappyeyeballs==2.4.0
aiohttp==3.10.5
aiosignal==1.3.1
altair==4.2.2
attrs==24.2.0
blinker==1.8.2
cachetools==5.5.0
certifi==2024.8.30
cfgv==3.4.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.3
datasets==2.4.0
dill==0.3.5.1
distlib==0.3.8
embeddings==0.0.8
entrypoints==0.4
filelock==3.15.4
frozenlist==1.4.1
fsspec==2024.6.1
gitdb==4.0.11
GitPython==3.1.43
huggingface-hub==0.24.6
hypothesis==6.54.0
identify==2.6.0
idna==3.8
importlib_metadata==8.4.0
iniconfig==2.0.0
Jinja2==3.1.4
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
llvmlite==0.43.0
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mdurl==0.1.2
-e git+ssh://[email protected]/choo8/Module-0.git@0e47013afcb065a3bdb793536ce01359e5bd2ef8#egg=minitorch
mpmath==1.3.0
multidict==6.0.5
multiprocess==0.70.13
networkx==3.3
nodeenv==1.9.1
numba==0.60.0
numpy==2.0.0
packaging==24.1
pandas==2.2.2
pillow==10.4.0
platformdirs==4.2.2
plotly==4.14.3
pluggy==1.5.0
pre-commit==2.20.0
protobuf==3.20.3
pyarrow==17.0.0
pydeck==0.9.1
pydot==1.4.1
Pygments==2.18.0
Pympler==1.1
pyparsing==3.1.4
pytest==8.3.2
pytest-env==1.1.3
pytest-runner==5.2
python-dateutil==2.9.0.post0
python-mnist==0.7
pytz==2024.1
pywin32==306
PyYAML==6.0.2
referencing==0.35.1
requests==2.32.3
responses==0.18.0
retrying==1.3.4
rich==13.8.0
rpds-py==0.20.0
semver==3.0.2
six==1.16.0
smmap==5.0.1
sortedcontainers==2.4.0
streamlit==1.12.0
streamlit-ace==0.1.1
sympy==1.13.2
toml==0.10.2
toolz==0.12.1
torch==2.4.0
tornado==6.4.1
tqdm==4.66.5
typing_extensions==4.12.2
tzdata==2024.1
tzlocal==5.2
urllib3==2.2.2
validators==0.33.0
virtualenv==20.26.3
watchdog==1.0.2
xxhash==3.5.0
yarl==1.9.6
zipp==3.20.1

When I run streamlit run project\app.py -- 0, I receive this error:

RuntimeError: Numpy is not available
Traceback:
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 556, in _run_script
    exec(code, module.__dict__)
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\project\app.py", line 116, in <module>
    page()
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\project\app.py", line 57, in render_run_torch_interface
    render_train_interface(TorchTrain, False)
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\.\project\interface\train.py", line 84, in render_train_interface
    st.write(plot())
             ^^^^^^
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\.\project\interface\train.py", line 79, in plot
    fig = plots.plot_out(dataset, contour, size=15, oned=oned)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\.\project\interface\plots.py", line 129, in plot_out
    scatters = make_scatters(graph, model, size=size)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\.\project\interface\plots.py", line 18, in make_scatters
    go.Contour(
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\plotly\graph_objs\_contour.py", line 2895, in __init__
    self["z"] = _v
    ~~~~^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\plotly\basedatatypes.py", line 4804, in __setitem__
    self._set_prop(prop, value)
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\plotly\basedatatypes.py", line 5143, in _set_prop
    val = validator.validate_coerce(val)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 391, in validate_coerce
    v = to_scalar_or_list(v)
        ^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 43, in to_scalar_or_list
    return [to_scalar_or_list(e) for e in v]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 43, in <listcomp>
    return [to_scalar_or_list(e) for e in v]
            ^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 43, in to_scalar_or_list
    return [to_scalar_or_list(e) for e in v]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 43, in <listcomp>
    return [to_scalar_or_list(e) for e in v]
            ^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 51, in to_scalar_or_list
    return to_scalar_or_list(np.array(v))
                             ^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\torch\_tensor.py", line 1083, in __array__
    return self.numpy()
           ^^^^^^^^^^^^

I resolved it by downgrading numpy to 1.26.4, as I saw this warning when running streamlit:

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions