After installing pandas and some other dependencies, this error occurred when I ran my program.
Traceback (most recent call last):
File "/home/nielson-scientific/schreiber-uv-led-sterilization-system/src/main.py", line 8, in <module>
from Tabs.SystemHistory import SystemHistory
File "/home/nielson-scientific/schreiber-uv-led-sterilization-system/src/Tabs/SystemHistory.py", line 9, in <module>
from Utils.CSV import CsvData
File "/home/nielson-scientific/schreiber-uv-led-sterilization-system/src/Utils/CSV.py", line 7, in <module>
import pandas as pd
File "/home/nielson-scientific/.local/lib/python3.9/site-packages/pandas/__init__.py", line 22, in <module>
from pandas.compat import is_numpy_dev as _is_numpy_dev
File "/home/nielson-scientific/.local/lib/python3.9/site-packages/pandas/compat/__init__.py", line 15, in <module>
from pandas.compat.numpy import (
File "/home/nielson-scientific/.local/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py", line 4, in <module>
from pandas.util.version import Version
File "/home/nielson-scientific/.local/lib/python3.9/site-packages/pandas/util/__init__.py", line 1, in <module>
from pandas.util._decorators import ( # noqa:F401
File "/home/nielson-scientific/.local/lib/python3.9/site-packages/pandas/util/_decorators.py", line 14, in <module>
from pandas._libs.properties import cache_readonly # noqa:F401
File "/home/nielson-scientific/.local/lib/python3.9/site-packages/pandas/_libs/__init__.py", line 13, in <module>
from pandas._libs.interval import Interval
File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 48 from C header, got 40 from PyObject
I have tried upgrading the version of numpy and that printed out new different error saying numpy import error.
nielson-scientific#pi:~/schreiber-uv-led-sterilization-system $ python3 src/main.py
Traceback (most recent call last):
File "/home/nielson-scientific/schreiber-uv-led-sterilization-system/src/main.py", line 8, in <module>
from Tabs.SystemHistory import SystemHistory
File "/home/nielson-scientific/schreiber-uv-led-sterilization-system/src/Tabs/SystemHistory.py", line 9, in <module>
from Utils.CSV import CsvData
File "/home/nielson-scientific/schreiber-uv-led-sterilization-system/src/Utils/CSV.py", line 7, in <module>
import pandas as pd
File "/home/nielson-scientific/.local/lib/python3.9/site-packages/pandas/__init__.py", line 16, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy:
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.9 from "/usr/bin/python3"
* The NumPy version is: "1.22.4"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: libcblas.so.3: cannot open shared object file: No such file or directory
Anyone have Idea how to fix this?
Related
I'm new to conda, but I'm sure I have pandas installed in the base environment. I also have selected it as the python interpreter in VSCode. However, when I try to import pandas it throws the following error:
Traceback (most recent call last):
File "/Users/raimundbuehler/Documents/UNIDOCS/Python:Psychopy:RALT/Rando/Randomization.py", line 2, in <module>
import pandas as pd
File "/Users/raimundbuehler/opt/anaconda3/lib/python3.9/site-packages/pandas/__init__.py", line 22, in <module>
from pandas.compat import is_numpy_dev as _is_numpy_dev
File "/Users/raimundbuehler/opt/anaconda3/lib/python3.9/site-packages/pandas/compat/__init__.py", line 15, in <module>
from pandas.compat.numpy import (
File "/Users/raimundbuehler/opt/anaconda3/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py", line 4, in <module>
from pandas.util.version import Version
File "/Users/raimundbuehler/opt/anaconda3/lib/python3.9/site-packages/pandas/util/__init__.py", line 1, in <module>
from pandas.util._decorators import ( # noqa:F401
File "/Users/raimundbuehler/opt/anaconda3/lib/python3.9/site-packages/pandas/util/_decorators.py", line 14, in <module>
from pandas._libs.properties import cache_readonly # noqa:F401
File "/Users/raimundbuehler/opt/anaconda3/lib/python3.9/site-packages/pandas/_libs/__init__.py", line 13, in <module>
from pandas._libs.interval import Interval
ImportError: dlopen(/Users/raimundbuehler/opt/anaconda3/lib/python3.9/site-packages/pandas/_libs/interval.cpython-39-darwin.so, 0x0002): rebase opcodes terminated early at offset 1 of 1800
I'm assuming numpy to be the problem, but updating both numpy and pandas didn't solve it. It may also be because I have Pycharm and pip installed, so it may be messy regarding multiple installations of python and packages... in fact in Pycharm, I can import pandas (using a different interpreter). Any help how to find out if this is indeed the case and how to solve it would be greatly appreciated!
I refer to this issue.
I think the feasible way may still be to unload and reinstall.
I'm trying to use cvxpy on a pythonanywhere server, the installation was ok, no errors however when i want to import cvpxy as cp, i have an error, help me please
the error :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/__init__.py", line 18, in <module>
from cvxpy.atoms import *
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/atoms/__init__.py", line 17, in <module>
from cvxpy.atoms.cummax import cummax
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/atoms/cummax.py", line 17, in <module>
from cvxpy.atoms.atom import Atom
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/atoms/atom.py", line 21, in <module>
from cvxpy.expressions.constants import Constant
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/expressions/constants/__init__.py", line 17, in <module>
from .constant import Constant
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/expressions/constants/constant.py", line 22, in <module>
from scipy.sparse.linalg import eigsh
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/scipy/sparse/linalg/__init__.py", line 111, in <module>
from .isolve import *
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/scipy/sparse/linalg/isolve/__init__.py", line 4, in <module>
from .iterative import *
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/scipy/sparse/linalg/isolve/iterative.py", line 8, in <module>
from . import _iterative
ImportError: /home/padacore/.virtualenvs/env/lib/python3.7/site-packages/scipy/sparse/linalg/isolve/../../../../scipy.libs/libopenblasp-r0-085ca80a.3.9.so: cannot read file data
It could be something to do with Atom, try switching to another editor. I recommend PyCharm or VSCode. If you're choosing VSCode, install these extensions: Python, PyLance, and Jupyter.
If you don't like VSCode's default themes, and miss Atom's One Dark, then there's an extension just for that! Just search for it, and you'll find it!
EDIT: If it wasn't something to do with Atom, maybe install an older version of cvxpy
I'm trying to run a script my client has provided, but I can't get it to start; it seems certainly a setup question on my machine, as it works for them. I started by installing WinPython from http://scipy.org/, but I'm now getting the following traceback:
Traceback (most recent call last):
File "pyconsole.py", line 18, in <module>
import cocomo
File "pyconsole\cocomo.py", line 13, in <module>
import grupple
File "pyconsole\grupple.py", line 4, in <module>
import matplotlib.mlab as mlab
File "C:\Users\lab\AppData\Roaming\Python\Python27\site-packages\matplotlib\__init__.py", line 134, in <module>
from matplotlib.rcsetup import (defaultParams,
File "C:\Users\lab\AppData\Roaming\Python\Python27\site-packages\matplotlib\rcsetup.py", line 19, in <module>
from matplotlib.colors import is_color_like
File "C:\Users\lab\AppData\Roaming\Python\Python27\site-packages\matplotlib\colors.py", line 52, in <module>
import numpy as np
File "C:\Users\lab\AppData\Roaming\Python\Python27\site-packages\numpy\__init__.py", line 137, in <module>
import add_newdocs
File "C:\Users\lab\AppData\Roaming\Python\Python27\site-packages\numpy\add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "C:\Users\lab\AppData\Roaming\Python\Python27\site-packages\numpy\lib\__init__.py", line 13, in <module>
from polynomial import *
File "C:\Users\lab\AppData\Roaming\Python\Python27\site-packages\numpy\lib\polynomial.py", line 17, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "C:\Users\lab\AppData\Roaming\Python\Python27\site-packages\numpy\linalg\__init__.py", line 48, in <module>
from linalg import *
File "C:\Users\lab\AppData\Roaming\Python\Python27\site-packages\numpy\linalg\linalg.py", line 23, in <module>
from numpy.linalg import lapack_lite
ImportError: DLL load failed: The specified module could not be found.
I'm not confident in interpreting Python tracebacks, but it seems that "lapack_lite" is missing? Searching around a bit seems surprisingly unhelpful; the best I've seemed to determine is that it is part of numpy? But that's odd, as the reason I started with the WinPython distribution is that the numpy stack is pre-installed, and that is the easiest way to get started with that.
What am I missing?
Thanks!
i think the easiest way under Windows would be to simply install Anaconda (this takes care of all the dependencies of Numpy and Scipy). You can download it from here:
https://www.continuum.io/downloads
This way you dont have to scroll through pages of Documentation on how to get all dependencies right.
Kind regards
Johann
When I try to use this command line to run this python code:
~/Tools/find_differential_primers/utils python stitch_six_frame_stops.py seq.fa
Error code will be displayed as followed. could you help me solve this problem.
Traceback (most recent call last):
File "stitch_six_frame_stops.py", line 55, in <module>
import matplotlib
File "/usr/local/lib/python2.7/dist-packages/matplotlib-1.3.x-py2.7-macosx-10.8 intel.egg/matplotlib/__init__.py", line 129, in <module>
from matplotlib.cbook import is_string_like
File "/usr/local/lib/python2.7/dist-packages/matplotlib-1.3.x-py2.7-macosx-10.8-intel.egg/matplotlib/cbook.py", line 28, in <module>
import numpy as np
File "/usr/local/lib/python2.7/dist-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/__init__.py", line 140, in <module>
from . import add_newdocs
File "/usr/local/lib/python2.7/dist-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/dist-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/lib/__init__.py", line 6, in <module>
from .type_check import *
File "/usr/local/lib/python2.7/dist-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/dist-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/__init__.py", line 6, in <module>
from . import multiarray
ImportError: /usr/local/lib/python2.7/dist-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/multiarray.so: invalid ELF header
You are trying to use a .so file in Mac OSX! .so files work on Linux; Mac OSX works with .dynld files. You probably may want to verify your NumPy Installation.
Assuming you are using OSX Lion, please see here for how to install NumPy on the OSX.
I have python 2.4 installed on an ARM processor and have moved all of the libraries I need onto this machine including those for numpy 1.6.2 When I try to import numpy, I get the following:
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/numpy/__init__.py", line 137, in ?
import add_newdocs
File "/usr/lib/python2.4/site-packages/numpy/add_newdocs.py", line 9, in ?
from numpy.lib import add_newdoc
File "/usr/lib/python2.4/site-packages/numpy/lib/__init__.py", line 4, in ?
from type_check import *
File "/usr/lib/python2.4/site-packages/numpy/lib/type_check.py", line 8, in ?
import numpy.core.numeric as _nx
File "/usr/lib/python2.4/site-packages/numpy/core/__init__.py", line 5, in ?
import multiarray
ImportError: /usr/lib/python2.4/site-packages/numpy/core/multiarray.so: cannot open shared object file: No such file or directory
When I try to see if the file exists I get:
# ls /usr/lib/python2.4/site-packages/numpy/core/ | grep multi
multiarray.so
I'm pretty new to python in general and don't know why I'm getting this error. Any suggestions?
this is indeed the first error you have when you are trying to import numpy with binaries for the wrong architecture.
some inspiration for compiling to arm : https://github.com/kivy/python-for-android