importerror

Import Error: Missing optional dependecy 'openpyxl.'

Import Error: Missing optional dependecy 'openpyxl.' Question: I am familiar with using pip to install Python packages but there is no way to install it in the environment I am working in. We have to call the directory with python.exe to run any Python code. Therefore, it is impossible to use pip install because, since …

Total answers: 1

(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) Question: I have a problem when I run a .py file on a Macbook Air M1: [Running] python3 -u "/Users/kaiyuwei/Documents/graduation project/metaheuristics/run_CRO.py" Traceback (most recent call last): File "/Users/kaiyuwei/Library/Python/3.8/lib/python/site-packages/numpy/core/__init__.py", line 23, in <module> from . import multiarray File "/Users/kaiyuwei/Library/Python/3.8/lib/python/site-packages/numpy/core/multiarray.py", line 10, in <module> from . …

Total answers: 3

importerror: "file too short"

Why I canot import _crop_and_resize in python? Question: I have two below files (header and c++), and I built them using Linux to "_crop_and_resize.so" file (c++ code is here). Could you please let me know how to fix the following issue? crop_and_resize.c crop_and_resize.h sources = [‘src/crop_and_resize.c’] headers = [‘src/crop_and_resize.h’] extra_compile_args = [‘-fopenmp’, ‘-std=c99’] sources = …

Total answers: 1

Ursina not importing in python

Ursina not importing in python Question: I’m getting error: Traceback (most recent call last): File "C:UsersuserDownloadsblockymain.py", line 1, in <module> import ursina as ue ModuleNotFoundError: No module named ‘ursina’ I tried: pip install ursina wait I also did python -m pip install ursina Asked By: Srinivasan || Source Answers: Since you’re using import ursina as …

Total answers: 4

Unable to import statsmodels on jupyter notebook

Unable to import statsmodels on jupyter notebook Question: I’ve installed statsmodels and it says "requirement already satisfied", but when I import it I get an error that the module doesn’t exist. conda update -n base -c defaults conda pip install statsmodels import statsmodel.api as sm import yfinance as yf import matplotlib.pyplot as plt import datetime …

Total answers: 2

"Most likely due to circular import" in Python

"Most likely due to circular import" in Python Question: import threading import time start = time.perf_counter() def do_something(): print("Sleeping in 1 second") time.sleep(1) print("Done sleeping") t1 = threading.Thread(target=do_something) t2 = threading.Thread(target=do_something) finish = time.perf_counter() print(f"Finished in {round(finish-start,1)} seconds(s) ") Does anyone know why this piece of code returns this error when run and how to …

Total answers: 3

Import Error: can't import name gcd from fractions

Import Error: can't import name gcd from fractions Question: I’m trying to import a function called gcd from a module called fractions with from fractions import gcd. For some reason, PyCharm throws an ImportError: from fractions import gcd ImportError: cannot import name ‘gcd’ from ‘fractions’ I had this working before, what am I doing wrong? …

Total answers: 6

ImportError while importing PySide2

ImportError while importing PySide2 Question: I installed PySide2 using pip install PySide2 But i got this error when i tried to import it: >>> import PySide2 PySide2/__init__.py: Unable to import shiboken2 from , C:UsersiliaAppDataLocalProgramsPythonPython38Libidlelib, C:UsersiliaAppDataLocalProgramsPythonPython38python38.zip, C:UsersiliaAppDataLocalProgramsPythonPython38DLLs, C:UsersiliaAppDataLocalProgramsPythonPython38lib, C:UsersiliaAppDataLocalProgramsPythonPython38, C:UsersiliaAppDataRoamingPythonPython38site-packages, C:UsersiliaAppDataLocalProgramsPythonPython38libsite-packages Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> import PySide2 File "C:UsersiliaAppDataLocalProgramsPythonPython38libsite-packagesPySide2__init__.py", …

Total answers: 1

I cannot use opencv2 and received ImportError: libgl.so.1 cannot open shared object file no such file or directory

I cannot use opencv2 and received ImportError: libgl.so.1 cannot open shared object file no such file or directory Question: **env:**ubuntu16.04 anaconda3 python3.7.8 cuda10.0 gcc5.5 command: conda activate myenv python import cv2 error: Traceback (most recent call last): File "", line 1, in File "/home/.conda/envs/myenv/lib/python3.7/site-packages/cv2/__init__.py", line 5, in from .cv2 import * ImportError: libGL.so.1: cannot open …

Total answers: 3