aimacode / aima-python

Python implementation of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"
MIT License
7.97k stars 3.76k forks source link

Installation problem on M1 Mac #1260

Closed canacosmic closed 2 years ago

canacosmic commented 2 years ago

I have succesfully installed TensorFlow using a virtual environment. I followed these steps and successfully ran the benchmark.

After that, I began to carefully follow AIMA's installation guide. Note that I am installing all this on my virtual environment named AIMA_ENV. After running the command pip install -r requirements.txt I get my two first errors:

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow

I decided to ignore this warning since I knew I had already successfully installed TensorFlow and continued with the installation process.

no errors are shown until I run py.test

the errors shown are:

__________________________________________________________________________________ ERROR collecting tests/test_agents.py ___________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_agents.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_agents.py:5: in <module>
    from agents import (ReflexVacuumAgent, ModelBasedVacuumAgent, TrivialVacuumEnvironment, compare_agents,
agents.py:34: in <module>
    from ipythonblocks import BlockGrid
E   ModuleNotFoundError: No module named 'ipythonblocks'
_________________________________________________________________________________ ERROR collecting tests/test_agents4e.py __________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_agents4e.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_agents4e.py:5: in <module>
    from agents4e import (ReflexVacuumAgent, ModelBasedVacuumAgent, TrivialVacuumEnvironment, compare_agents,
agents4e.py:39: in <module>
    from ipythonblocks import BlockGrid
E   ModuleNotFoundError: No module named 'ipythonblocks'
____________________________________________________________________________________ ERROR collecting tests/test_csp.py ____________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_csp.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_csp.py:3: in <module>
    from csp import *
csp.py:11: in <module>
    from sortedcontainers import SortedSet
E   ModuleNotFoundError: No module named 'sortedcontainers'
______________________________________________________________________________ ERROR collecting tests/test_deep_learning4e.py ______________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_deep_learning4e.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_deep_learning4e.py:5: in <module>
    from learning4e import DataSet, grade_learner, err_ratio
learning4e.py:7: in <module>
    from qpsolvers import solve_qp
E   ModuleNotFoundError: No module named 'qpsolvers'
_________________________________________________________________________________ ERROR collecting tests/test_knowledge.py _________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_knowledge.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_knowledge.py:3: in <module>
    from knowledge import *
knowledge.py:10: in <module>
    from logic import (FolKB, constant_symbols, predicate_symbols, standardize_variables,
logic.py:40: in <module>
    import networkx as nx
E   ModuleNotFoundError: No module named 'networkx'
_________________________________________________________________________________ ERROR collecting tests/test_learning.py __________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_learning.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_learning.py:3: in <module>
    from learning import *
learning.py:7: in <module>
    from qpsolvers import solve_qp
E   ModuleNotFoundError: No module named 'qpsolvers'
________________________________________________________________________________ ERROR collecting tests/test_learning4e.py _________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_learning4e.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_learning4e.py:4: in <module>
    from learning4e import *
learning4e.py:7: in <module>
    from qpsolvers import solve_qp
E   ModuleNotFoundError: No module named 'qpsolvers'
___________________________________________________________________________________ ERROR collecting tests/test_logic.py ___________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_logic.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_logic.py:3: in <module>
    from logic import *
logic.py:40: in <module>
    import networkx as nx
E   ModuleNotFoundError: No module named 'networkx'
__________________________________________________________________________________ ERROR collecting tests/test_logic4e.py __________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_logic4e.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_logic4e.py:3: in <module>
    from logic4e import *
logic4e.py:37: in <module>
    from agents import Agent, Glitter, Bump, Stench, Breeze, Scream
agents.py:34: in <module>
    from ipythonblocks import BlockGrid
E   ModuleNotFoundError: No module named 'ipythonblocks'
_______________________________________________________________________________ ERROR collecting tests/test_perception4e.py ________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_perception4e.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_perception4e.py:5: in <module>
    from perception4e import *
perception4e.py:3: in <module>
    import cv2
E   ModuleNotFoundError: No module named 'cv2'
_________________________________________________________________________________ ERROR collecting tests/test_planning.py __________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_planning.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_planning.py:5: in <module>
    from planning import *
planning.py:11: in <module>
    from csp import sat_up, NaryCSP, Constraint, ac_search_solver, is_
<img width="1440" alt="errorimage" src="https://user-images.githubusercontent.com/61641010/185541219-359d71e7-ee51-4c63-b290-ce39e28f2490.png">
constraint
csp.py:11: in <module>
    from sortedcontainers import SortedSet
E   ModuleNotFoundError: No module named 'sortedcontainers'
__________________________________________________________________________ ERROR collecting tests/test_probabilistic_learning.py ___________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_probabilistic_learning.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_probabilistic_learning.py:5: in <module>
    from learning import DataSet
learning.py:7: in <module>
    from qpsolvers import solve_qp
E   ModuleNotFoundError: No module named 'qpsolvers'
________________________________________________________________________________ ERROR collecting tests/test_probability.py ________________________________________________________________________________
ImportError while importing test module '/Users/cosmic/Desktop/aima-python/tests/test_probability.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../mambaforge/envs/AIMA_ENV/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_probability.py:3: in <module>
    from probability import *
probability.py:6: in <module>
    from agents import Agent
agents.py:34: in <module>
    from ipythonblocks import BlockGrid
E   ModuleNotFoundError: No module named 'ipythonblocks'
========================================================================================= short test summary info ==========================================================================================
ERROR tests/test_agents.py
ERROR tests/test_agents4e.py
ERROR tests/test_csp.py
ERROR tests/test_deep_learning4e.py
ERROR tests/test_knowledge.py
ERROR tests/test_learning.py
ERROR tests/test_learning4e.py
ERROR tests/test_logic.py
ERROR tests/test_logic4e.py
ERROR tests/test_perception4e.py
ERROR tests/test_planning.py
ERROR tests/test_probabilistic_learning.py
ERROR tests/test_probability.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 13 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================================ 13 errors in 2.81s ============================================================================================
(AIMA_ENV) cosmic@Cosmics-MacBook-Air aima-python % 

I'm attaching a screenshot of the errors.

I have get the same errors as kgreed but his solution can't apply to my problem.

I'm running all this on a Virtual Environment with python 3.8, TensorFlow, Jupiter notebooks, on a m1 chip and macOs 12.5.

errorimage