Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR tests/test_perception4e.py #1253

Open
VyS95 opened this issue Apr 23, 2022 · 1 comment
Open

ERROR tests/test_perception4e.py #1253

VyS95 opened this issue Apr 23, 2022 · 1 comment

Comments

@VyS95
Copy link

VyS95 commented Apr 23, 2022

I followed the installation guide and after runing py.test I got this error:

`PS C:\Windows\System32\aima-python> py.test
===================== test session starts===================================
platform win32 -- Python 3.9.7, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: C:\Windows\System32\aima-python, configfile: pytest.ini
plugins: anyio-2.2.0, cov-3.0.0
collected 410 items / 1 error / 409 selected

====================== ERRORS ===========================
_______ ERROR collecting tests/test_perception4e.py _____________________
ImportError while importing test module 'C:\Windows\System32\aima-python\tests\test_perception4e.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\ProgramData\Anaconda3\lib\importlib_init_.py:127: in import_module
return _bootstrap.gcd_import(name[level:], package, level)
tests\test_perception4e.py:5: in
from perception4e import *
perception4e.py:3: in
import cv2
C:\ProgramData\Anaconda3\lib\site-packages\cv2_init
.py:8: in
from .cv2 import *
E ImportError: DLL load failed while importing cv2: The specified module could not be found.
================ short test summary info ==================================
ERROR tests/test_perception4e.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================= 1 error in 4.82s ===================================
PS C:\Windows\System32\aima-python>`

I tried
pip install keras==2.4.0

pip install --upgrade pip

pip install tensorflow

pip install tf-nightly

please help me fix. thank you

@meloncruuush
Copy link

I encountered this issue when running the tests outside of a virtual environment. You probably have newer versions of this libraries already installed, which is what is possibly causing the issue.
I suggest that you create a virtual environment specific for this repo, and then follow the installation procedure again.

In case you don't know how to do it, and for future users, here is a modified version of the installation guide with the addition of virtual environments.

Installation Guide with Venv

To download the repository:

git clone https://github.com/aimacode/aima-python.git

cd aima-python

Create the virtual environment

python -m venv .env

Activate the virtual environment

./.env/Scripts/activate

Then you need to install the basic dependencies to run the project on your system:

pip install -r requirements.txt

You also need to fetch the datasets from the aima-data repository:

git submodule init
git submodule update

Wait for the datasets to download, it may take a while. Once they are downloaded, you need to install pytest, so that you can run the test suite:

pip install pytest

Then to run the tests:

py.test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants