GithubHelp home page GithubHelp logo

Comments (3)

SmallMousePP avatar SmallMousePP commented on May 24, 2024

============================================================

[Start running..]
OpenCV bindings requires "numpy" package.
Install it via command:
pip install numpy
Traceback (most recent call last):
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/init.py", line 24, in
from . import multiarray
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/multiarray.py", line 10, in
from . import overrides
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/overrides.py", line 8, in
from numpy.core._multiarray_umath import (
ImportError: dlopen(/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so, 0x0002): tried: '/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (no such file), '/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/init.py", line 130, in
from numpy.config import show as show_config
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/config.py", line 4, in
from numpy.core._multiarray_umath import (
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/init.py", line 50, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.10 from "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/bin/python3.10"
  • The NumPy version is: "1.26.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: dlopen(/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so, 0x0002): tried: '/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (no such file), '/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Applications/AirtestIDE.app/Contents/MacOS/sample/custom_launcher.py", line 7, in
from airtest.cli.runner import run_script
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/airtest/cli/runner.py", line 12, in

from airtest.core.api import G, auto_setup, log

File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/airtest/core/api.py", line 8, in
from airtest.core.cv import Template, loop_find, try_log_screen
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/airtest/core/cv.py", line 13, in
from airtest import aircv
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/airtest/aircv/init.py", line 1, in
from .aircv import * # noqa
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/airtest/aircv/aircv.py", line 5, in
import cv2
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/cv2/init.py", line 11, in
import numpy
File "/Users/kamiyeung/.local/share/virtualenvs/Pytest_Allure_Airtest-baQG2VD3/lib/python3.10/site-packages/numpy/init.py", line 135, in
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
[Finished]

============================================================

from airtestide.

SmallMousePP avatar SmallMousePP commented on May 24, 2024

尝试过使用非虚拟环境的本地python也是一样的报错。。

from airtestide.

SmallMousePP avatar SmallMousePP commented on May 24, 2024

已解决,是由于arm平台指令和x86不一样,在ide中使用的话,似乎都是用的x86的那一套,解决方法是在命令行临时修改成x86模式再去创建虚拟环境以及下载x86的python依赖包,在ide中设置python路径指向该虚拟环境即可
image

from airtestide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.