Unable to run python package AIBenchmark on 13 inch m1 MacBook Pro - python-3.x

I got a new m1 MacBook Pro and installed the TensorFlow 2 provided by Apple, and I decided to do some testing for the MacBook, so I installed the python3 package "AIBenchmark", and the process was successful without any error messages. However, when I imported it, the following error message appeared.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/andrew/tensorflow_macos_venv/lib/python3.8/site-packages/ai_benchmark/__init__.py",
line 5, in <module>
from ai_benchmark.utils import *
File "/Users/andrew/tensorflow_macos_venv/lib/python3.8/site-packages/ai_benchmark/utils.py",
line 10, in <module>
from PIL import Image
File "/Users/andrew/tensorflow_macos_venv/lib/python3.8/site-packages/PIL/Image.py",
line 94, in <module>
from . import _imaging as core ImportError: dlopen(/Users/andrew/tensorflow_macos_venv/lib/python3.8/site-packages/PIL/_imaging.cpython-38-darwin.so,
2): no suitable image found. Did find:
/Users/andrew/tensorflow_macos_venv/lib/python3.8/site-packages/PIL/_imaging.cpython-38-darwin.so:
mach-o, but wrong architecture
/Users/andrew/tensorflow_macos_venv/lib/python3.8/site-packages/PIL/_imaging.cpython-38-darwin.so:
mach-o, but wrong architecture
How do I solve this problem?

I'm guessing that since AI Benchmark has not been updated since Dec. 18, 2019, the library is an Intel architecture binary. I don't know the details of the python 3.8 installation via the Xcode Command Line Tools, but I imagine it's a universal binary (both Intel and Apple Arm64 architecture). My guess is that you'll have to run TensorFlow as an Intel binary, so I would try the following in the terminal: precede your command to startup your app with
arch -x86_64
Or, configure Terminal to run under Rosetta2.
Right-click on Terminal in Finder
Get Info
Open with Rosetta
More suggestions here (no, it's not python or TensorFlow related, but yes, it's relevant).

Related

Airflow No module named 'wtforms.compat'

recently i have been trying to install airflow on my Macbook pro( 2 GHz Quad-Core Intel Core i5)
However, i have been facing persistent problems in trying to create a virtual environment(venv) where i can install airflow.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/airflow", line 26, in <module>
from airflow.bin.cli import CLIFactory
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airflow/bin/cli.py", line 82, in <module>
from airflow.www.app import (cached_app, create_app)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airflow/www/app.py", line 42, in <module>
from airflow.www.blueprints import routes
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airflow/www/blueprints.py", line 25, in <module>
from airflow.www import utils as wwwutils
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airflow/www/utils.py", line 36, in <module>
from wtforms.compat import text_type
ModuleNotFoundError: No module named 'wtforms.compat'
System Description:
1.Macbook pro( 2 GHz Quad-Core Intel Core i5)
2.Python Version (3.8.12)
Possible solutions:
I have installed airflow in accordance to the documentation
pip install "apache-airflow[celery]==2.2.3" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.2.3/constraints-3.8.txt"
I have tried most solutions here as well as airflow github issues. Most recommend reinstalling which i did as well. Some include changing wtforms == 2.3.3 but to no avail as well.
I have exhuasted most of my means i hope stackoverflow can guide me through this. Lastly, thank you in advance and i hope to learn from you
You are using Python 3.9 not python 3.8
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/airflow", line 26, in <module>
Apparently for some reason you mixed those. You should make sure you both CREATE and ACTIVATE virtualenv and install airflow in the right virtualenv.

Can someone explain what this error I get when importing Pandas means?

I’m a linux and Pandas newbie and just tried to install Pandas in my x86 Linux shell running in the “iSH” shell of my iPad. I downloaded the package with the shell’s Alpine Linux Package Manager. When I went to “import Pandas” into Python 3, linux gave me the following error:
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/site-packages/pandas/__init__.py", line 144, in <module>
from pandas.io.api import (
File "/usr/lib/python3.8/site-packages/pandas/io/api.py", line 8, in <module>
from pandas.io.excel import ExcelFile, ExcelWriter, read_excel
File "/usr/lib/python3.8/site-packages/pandas/io/excel/__init__.py", line 1, in <module>
from pandas.io.excel._base import ExcelFile, ExcelWriter, read_excel
Error relocating /usr/lib/python3.8/site- packages/pandas/_libs/parsers.cpython-38-i386-linux-gnu.so: __fstat_time64: symbol not found
Could anyone explain the error to me? I’ve installed all the dependencies successfully that pandas package said it needed.
I realize it also may just not be working due to the complexity of trying to run Pandas in a Linux emulator shell on an iPad. However, other modules have worked well so I thought I would give it a try.
Thanks!
Sorry, everyone. Although I didn’t figure out what the error meant, I did resolve the error by upgrading to the newest Alpine Linux version (3.13) which imports Pandas fine.

TensorFlow-GPU 1.12.0 + CUDA 9 + cuDNN 7.41 on Windows throws DLL load failed. Same bundle works on Ubuntu

As in title I have
CUDA 9.0.176
cuDNN v7.4.1
TF-GPU 1.12
Python 3.6.6
I can confirm that path both to bin/lib for CUDA is in a PATH and also there is a path to cuda folder (not sure why if same files were copieed to CUDA folder (nvidia not a custom one as per tutorials)).
import tensorflow
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\OtherCode\Teest1\test1\lib\site-
packages\tensorflow\__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint:
disable=unused-import
File "D:\OtherCode\Teest1\test1\lib\site-
packages\tensorflow\python\__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "D:\OtherCode\Teest1\test1\lib\site-
packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
from google.protobuf import descriptor as _descriptor
File "D:\OtherCode\Teest1\test1\lib\site-
packages\google\protobuf\descriptor.py", line 47, in <module>
from google.protobuf.pyext import _message
ImportError: DLL load failed: The specified procedure could not be found.
I've tried pretty much many other different bundles after that (using Tensorflow table showing tested configurations), but none of them works.
I have all files in System32 that I've found info about, I have VS 2017 / 2019 + install the compile for 2015.
Nothing works.
Is there anything on Windows that I need to be aware of ?
Same bundle works fine on Ubuntu pretty much instantly, on Windows it fails terribly.
I would prefer use windows as there is number of issues with ubuntu (most of hardware is not supported on Ubuntu + I am using VS Studio for most of the projects).
I've tried CUDA 8.0, CUDA 9.0, CUDA 9.2, CUDA 10 (with different cuDNN for specific version + different tensorflows according to the table, however it looks like there is something else missing).
Unfortunately for some reason this combo won't work.
Other with CUDA 10 worked.

python 3 no module named _tkinter

I've been searching for it but could not find anything on the net on this topic.
When I'm working on a programm in python 3.5 which imports tkinter or pyglet I'm perfectly able to start it from the command line on my Linux Mint installation. As soon as I try to start it from pycharm or Visual Studio Code I get an error.
It is for tkinter:
Traceback (most recent call last): File "/home/b...", line 3, in <module>
import tkinter as tk
File "/usr/lib/python3.5/tkinter/__init__.py", line 35, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named '_tkinter'
Both, the tkinter and the pyglet script, are working when they are started from idle3 (with F5).
Can anyone help me out?
Best
B.
i'm having the same issue. The problem lie with Linux Mint Software Manager. If your vs code is install via Software Manager, it will be install in Flatpak virtual sandbox. Just download and run vs code from its homepage will do.

RISCV debug tests - 'gdbserver.py' fails for missing module

When I try to run the following in the /riscv-tests/debug directory
it fails.
./gdbserver.py --spike64 --cmd ../../bin/spike
Traceback (most recent call last):
File "./gdbserver.py", line 10, in
import targets
File "/home/dave/MyProjects/RiscV/build/riscv-tools/riscv-tests/debug/targets.py", line 4, in
import testlib
File "/home/dave/MyProjects/RiscV/build/riscv-tools/riscv-tests/debug/testlib.py", line 9, in
import pexpect
ImportError: No module named pexpect
I have searched the entire RISCV installation for "pexpect.py" with no success. I installed the complete RISCV toolchain. I can build code and run
the ISA simulator using spike and pk.
Looks like the problem is with my python installation. I found 'python-pexpect' in my Linux package manager and installed. But I am now having errors with other python system libraries.

Resources