I am running Python 3.5.1 on Windows 10 and have Anaconda and IDLE installed.
If I run any Python files, pandas and numpy seem to work in Jupyter notebooks, but not in IDLE.
I have ensured that the PATH and PYTHONPATH environment variables include access to the folders where pandas and numpy are located (Lib/site-packages).
I receive the following error in IDLE when trying to import pandas:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pandas
File "C:\Users\me\AppData\Local\Continuum\Anaconda3\Lib\site-packages\pandas\__init__.py", line 18, in <module>
raise ImportError("Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
When I try to import numpy I get the following error:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import numpy
File "C:\Users\me\AppData\Local\Continuum\Anaconda3\Lib\site-packages\numpy\__init__.py", line 180, in <module>
from . import add_newdocs
File "C:\Users\me\AppData\Local\Continuum\Anaconda3\Lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\me\AppData\Local\Continuum\Anaconda3\Lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Users\me\AppData\Local\Continuum\Anaconda3\Lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\me\AppData\Local\Continuum\Anaconda3\Lib\site-packages\numpy\core\__init__.py", line 14, in <module>
from . import multiarray
ImportError: cannot import name 'multiarray'
Can someone help?
try this:
I had the same problem
https://stackoverflow.com/a/40637960/6376603
maybe the above answer will help.
I had similar problem. I uninstalled anaconda from my system completely.
Steps - Delete app, delete anaconda3 folder, empty trash
Then I reinstalled older version of it and it started working perfectly. Maybe it is some kind of bug in the newer version.
Related
I have installed matplotlib via pip3 in venv. After importing I get the error as below. Have changed the directory long path to ...PATH.
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "...PATH/lib/python3.11/site-packages/matplotlib/__init__.py", line 113, in <module>
from . import _api, _version, cbook, _docstring, rcsetup
File "...PATH/lib/python3.11/site-packages/matplotlib/rcsetup.py", line 27, in <module>
from matplotlib.colors import Colormap, is_color_like
File "...PATH/lib/python3.11/site-packages/matplotlib/colors.py", line 51, in <module>
from PIL import Image
File "...PATH/lib/python3.11/site-packages/PIL/Image.py", line 103, in <module>
from . import _imaging as core
ImportError: libwebp.so.6: cannot open shared object file: No such file or directory
After looking at pillow website I learnt that
Pillow >= 2.1.0 no longer supports import _imaging. Please use from
PIL.Image import core as _imaging instead.
I am using pillow 9.4.0. And the last line of matplotlib error says that it is importing _imaging, which is no more valid in pillow. Matplotlib version is 3.6.3.
For the missing shared library (libwebp), being complained in the error, I have verified that it is already installed via dev package.
Python python-3.9.13-amd64 works well in my windows 10 pro.
after uninstalling 3.9.13 and deleting "C:\Users\Admin\AppData\Local\Programs\Python\Python310\ directory , I have installed python-3.10.9-amd64.
It logs out with error:
Traceback (most recent call last):
File "D:\python\ccdtest1.py", line 7, in <module>
import pandas as pd
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\__init__.py", line 22, in <module>
from pandas.compat import is_numpy_dev as _is_numpy_dev # pyright: ignore # noqa:F401
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\compat\__init__.py", line 18, in <module>
from pandas.compat.numpy import (
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\compat\numpy\__init__.py", line 4, in <module>
from pandas.util.version import Version
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\util\__init__.py", line 8, in <module>
from pandas.core.util.hashing import ( # noqa:F401
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\util\hashing.py", line 24, in <module>
from pandas.core.dtypes.common import (
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\dtypes\common.py", line 27, in <module>
from pandas.core.dtypes.base import _registry as registry
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\dtypes\base.py", line 24, in <module>
from pandas.errors import AbstractMethodError
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\errors\__init__.py", line 6, in <module>
import ctypes
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ImportError: DLL load failed while importing _ctypes: The specified module could not be found.
Attempts made:
pip uinstalled pandas and installed again.
Using regedit, I added C:\Users\Admin\AppData\Local\Programs\Python\Python310\DLLs\ to path.
I copied libcrypto-1_1.dll,libssl-1_1.dll,libffi-7.dll from C:\Users\Admin\AppData\Local\Programs\Python\Python310\DLLs to my py program directory.
problem remains.
please help.
I found out the issue. There were some .pyd files in my py programs directory. I removed all .pyd, from my py programs directory.
I have installed python 3.11.1 and everything working well now.
I'm trying to run python code that uses the pandas library on the BeagleBone Black. I have all the necessary libraries and packages downloaded onto the device. When I try to run the code, I get an error regarding the numpy.ndarray size being changed. Currently, I am using Python 3.7.3, numpy 1.20.1, and pandas 1.3.5.
When I try to my python file, an error occurs with importing the pandas library. The traceback of the error I'm encountering is included below. I have tried the following to resolve this issue:
pip install --upgrade numpy
and
pip uninstall numpy
pip install numpy
as suggested here.
Traceback
root#beaglebone:/mnt/microSD# python chunkANDconvert.py
Traceback (most recent call last):
File "chunkANDconvert.py", line 2, in <module>
import pandas as pd
File "/usr/local/lib/python3.7/dist-packages/pandas/__init__.py", line 22, in <module>
from pandas.compat import (
File "/usr/local/lib/python3.7/dist-packages/pandas/compat/__init__.py", line 15, in <module>
from pandas.compat.numpy import (
File "/usr/local/lib/python3.7/dist-packages/pandas/compat/numpy/__init__.py", line 7, in <module>
from pandas.util.version import Version
File "/usr/local/lib/python3.7/dist-packages/pandas/util/__init__.py", line 1, in <module>
from pandas.util._decorators import ( # noqa
File "/usr/local/lib/python3.7/dist-packages/pandas/util/_decorators.py", line 14, in <module>
from pandas._libs.properties import cache_readonly # noqa
File "/usr/local/lib/python3.7/dist-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 44 from C header, got 40 from PyObject
Thank you in advance. I have pandas-datareader==0.7.0+7.g7949e60 succesfull installed, but when i run the scripts, appears this:
Traceback (most recent call last):
File "/home/pepew/sss/screener/cargadordatos.py", line 14, in <module>
from pandas_datareader import data as pdr
File "/home/pepew/.virtualenvs/myproject/lib/python3.5/site-packages/pandas_datareader/__init__.py", line 2, in <module>
from .data import (DataReader, Options, get_components_yahoo,
File "/home/pepew/.virtualenvs/myproject/lib/python3.5/site-packages/pandas_datareader/data.py", line 7, in <module>
from pandas_datareader.av.forex import AVForexReader
File "/home/pepew/.virtualenvs/myproject/lib/python3.5/site-packages/pandas_datareader/av/__init__.py", line 3, in <module>
from pandas_datareader.base import _BaseReader
File "/home/pepew/.virtualenvs/myproject/lib/python3.5/site-packages/pandas_datareader/base.py", line 13, in <module>
from pandas_datareader._utils import (RemoteDataError, SymbolWarning,
File "/home/pepew/.virtualenvs/myproject/lib/python3.5/site-packages/pandas_datareader/_utils.py", line 5, in <module>
from pandas_datareader.compat import is_number
File "/home/pepew/.virtualenvs/myproject/lib/python3.5/site-packages/pandas_datareader/compat/__init__.py", line 24, in <module>
from pandas.testing import assert_frame_equal
ImportError: No module named 'pandas.testing'
>>>
Pandas-datareader appears to require pandas version 0.19.2+. But the pandas.testing module was only added in 0.20.1
A workaround would be to upgrade the pandas package: pip install pandas -U
Pandas Datareader requires pandas version 0.19.2 or higher. This error is likely due to the fact that your pandas version is before 0.19.2. If this is the case, the best way to update pandas is:
pip install pandas -U
I am using pydev plugin in Eclipse Juno for my python programming in windows 7 and i am using python 3.2, it works fine while running python application which using standard python packages. For my one of my project i have to use pandas library, for that i download and install numpy and pandas Windows installer for python 3. But while running even a small program it shows error message. So anyone have any idea about how to install and test pandas in Windows 7 by using eclipse, just pass it to me.
The error message is like this:
Traceback (most recent call last):
import numpy
File "C:\Python32\lib\site-packages\numpy\__init__.py", line 137, in <module>
from . import add_newdocs
File "C:\Python32\lib\site-packages\numpy\add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "C:\Python32\lib\site-packages\numpy\lib\__init__.py", line 4, in <module>
from .type_check import *
File "C:\Python32\lib\site-packages\numpy\lib\type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "C:\Python32\lib\site-packages\numpy\core\__init__.py", line 40, in <module>
from numpy.testing import Tester
File "C:\Python32\lib\site-packages\numpy\testing\__init__.py", line 8, in <module>
from unittest import TestCase
File "C:\Python32\lib\unittest\__init__.py", line 59, in <module>
from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,
File "C:\Python32\lib\unittest\case.py", line 6, in <module>
import pprint
EOFError: EOF read where not expected
Thanks in advance for your time
I think you have Install panda: here you can find panda package for windows here
https://pypi.python.org/pypi/pandas#downloads