python3.9.x
python3
Python 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/.local/lib/python3.9/site-packages/pandas/__init__.py", line 22, in <module>
from pandas.compat import (
File "/home/pi/.local/lib/python3.9/site-packages/pandas/compat/__init__.py", line 15, in <module>
from pandas.compat.numpy import (
File "/home/pi/.local/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py", line 7, in <module>
from pandas.util.version import Version
File "/home/pi/.local/lib/python3.9/site-packages/pandas/util/__init__.py", line 1, in <module>
from pandas.util._decorators import ( # noqa
File "/home/pi/.local/lib/python3.9/site-packages/pandas/util/_decorators.py", line 14, in <module>
from pandas._libs.properties import cache_readonly # noqa
File "/home/pi/.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
the when I update numpy it said that it needs verson 3.9 ++
For the Python version you are using pandas is officially not supported. I would advise to uninstall 3.9 and install 3.7.
Before update or installing the new packages/libraries, always make sure that it is compatible with whatever version you are using.
Related
I am using pyrogram in a program but when i run the program it gives import error
i uninstalled and reinstalled it but the problem is still there.
I am not able to fix it i have tried the previous version as well as the new version but the problem is the same.
Here is the output:
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyrogram
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/__init__.py", line 40, in <module>
from . import raw, types, filters, handlers, emoji
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/types/__init__.py", line 22, in <module>
from .input_media import *
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/types/input_media/__init__.py", line 25, in <module>
from .input_phone_contact import InputPhoneContact
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/types/input_media/input_phone_contact.py", line 20, in <module>
from pyrogram.session.internals import MsgId
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/session/__init__.py", line 19, in <module>
from .auth import Auth
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/session/auth.py", line 29, in <module>
from pyrogram.crypto import aes, rsa, prime
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/crypto/prime.py", line 19, in <module>
from random import randint
File "/home/ak/Desktop/development/bots/pyrogramplugins/multiuserbot/final/random.py", line 1, in <module>
from pyrogram import Client, filters, idle
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/filters.py", line 24, in <module>
from pyrogram.types import Message, CallbackQuery, InlineQuery, InlineKeyboardMarkup, ReplyKeyboardMarkup, Update
ImportError: cannot import name 'Message' from partially initialized module 'pyrogram.types' (most likely due to a circular import) (/home/ak/.local/lib/python3.9/site-packages/pyrogram/types/__init__.py)
>>>
I am stuck here i have tried everything i know but not able to fix it
It is because the file name is same as the module name which I am using in code.
Change the file name and never give file a name which is the name of a module
Spark version 2.4.5, python version 3.8.2
Got the below error:
VirtualBox:~/spark-2.4.5-bin-hadoop2.7/python$ python3
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyspark
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/prasanth/spark-2.4.5-bin-hadoop2.7/python/pyspark/__init__.py", line 51, in <module>
from pyspark.context import SparkContext
File "/home/prasanth/spark-2.4.5-bin-hadoop2.7/python/pyspark/context.py", line 31, in <module>
from pyspark import accumulators
File "/home/prasanth/spark-2.4.5-bin-hadoop2.7/python/pyspark/accumulators.py", line 97, in <module>
from pyspark.serializers import read_int, PickleSerializer
File "/home/prasanth/spark-2.4.5-bin-hadoop2.7/python/pyspark/serializers.py", line 72, in <module>
from pyspark import cloudpickle
File "/home/prasanth/spark-2.4.5-bin-hadoop2.7/python/pyspark/cloudpickle.py", line 145, in <module>
_cell_set_template_code = _make_cell_set_template_code()
File "/home/prasanth/spark-2.4.5-bin-hadoop2.7/python/pyspark/cloudpickle.py", line 126, in _make_cell_set_template_code
return types.CodeType(
TypeError: an integer is required (got type bytes)
This issue happens because of spark doesn't compatible with python 3.8.x! please use python3.7. you can do it with this command:
PYSPARK_PYTHON=python3.7 pyspark
I am getting the below error while installing python 3 in SUSE SLES 12SP3, how do i get rid(skip) of the import readline error, I am i missing some step
:/tmp/Python-3.6.4> ./configure
./configure --prefix=/usr/local
make altinstall
: /usr/local/lib64> sudo ln -s /usr/local/lib/python3.6/lib-dynload/
/usr/local/lib> python3
Python 3.6.3 (default, Jan 8 2018, 10:26:56)
[GCC 4.8.5] on linux
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site.py", line 387, in register_readline
import readline
File "/usr/local/lib/python3.6/site-packages/readline.py", line 6, in <module>
from pyreadline.rlmain import Readline
File "/usr/local/lib/python3.6/site-packages/pyreadline/__init__.py", line 12, in <module>
from . import logger, clipboard, lineeditor, modes, console
File "/usr/local/lib/python3.6/site-packages/pyreadline/clipboard/__init__.py", line 13, in <module>
from .win32_clipboard import GetClipboardText, SetClipboardText
File "/usr/local/lib/python3.6/site-packages/pyreadline/clipboard/win32_clipboard.py", line 37, in <module>
import ctypes.wintypes as wintypes
File "/usr/local/lib/python3.6/ctypes/wintypes.py", line 20, in <module>
class VARIANT_BOOL(ctypes._SimpleCData):
ValueError: _type_ 'v' not supported
I was using sklearn library for many days, but sudunly today I cant import sklearn. There is some problem in sicpy library which I can't find solution for.
And this problem started exatly after I ran apt-get update
Here is the error I am getting.
Python 2.7.9 (default, Mar 1 2015, 12:57:24)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/sklearn/__init__.py", line 57, in <module>
from .base import clone
File "/usr/local/lib/python2.7/dist-packages/sklearn/base.py", line 12, in <module>
from .utils.fixes import signature
File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/__init__.py", line 11, in <module>
from .validation import (as_float_array,
File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 18, in <module>
from ..utils.fixes import signature
File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/fixes.py", line 45, in <module>
from scipy.special import expit # SciPy >= 0.10
File "/usr/lib/python2.7/dist-packages/scipy/special/__init__.py", line 643, in <module>
from ._ellip_harm import ellip_harm, ellip_harm_2, ellip_normal
File "/usr/lib/python2.7/dist-packages/scipy/special/_ellip_harm.py", line 7, in <module>
from ._ellip_harm_2 import _ellipsoid, _ellipsoid_norm
File "scipy/special/_ellip_harm_2.pyx", line 5, in init scipy.special._ellip_harm_2 (scipy/special/_ellip_harm_2.c:7330)
File "/usr/lib/python2.7/dist-packages/scipy/integrate/__init__.py", line 59, in <module>
from ._bvp import solve_bvp
File "/usr/lib/python2.7/dist-packages/scipy/integrate/_bvp.py", line 10, in <module>
from scipy.sparse.linalg import splu
File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/__init__.py", line 112, in <module>
from .isolve import *
File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/isolve/__init__.py", line 6, in <module>
from .iterative import *
File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/isolve/iterative.py", line 84, in <module>
def bicg(A, b, x0=None, tol=1e-5, maxiter=None, xtype=None, M=None, callback=None):
File "/usr/lib/python2.7/dist-packages/scipy/_lib/_threadsafety.py", line 59, in decorator
return lock.decorate(func)
File "/usr/lib/python2.7/dist-packages/scipy/_lib/_threadsafety.py", line 47, in decorate
return scipy._lib.decorator.decorate(func, caller)
AttributeError: 'module' object has no attribute 'decorate'
>>>
Solutions I tried:
Restarting pc
Reinstalling sklearn
Reinstalling sicpy
Banging my head to pc
Please help soon, as I need it to complete my semester project.
Update python-decorator.
Looks like dependency bug.
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import sklearn
sklearn.__version__
'0.16.1'
from sklearn.neighbors import NearestNeighbors
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/neighbors/__init__.py", line 9, in <module>
from .graph import kneighbors_graph, radius_neighbors_graph File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/neighbors/graph.py", line 9, in <module>
from .base import KNeighborsMixin, RadiusNeighborsMixin File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/neighbors/base.py", line 18, in <module>
from ..metrics import pairwise_distances File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/metrics/__init__.py", line 15, in <module>
from .classification import accuracy_score File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/metrics/classification.py", line 31, in <module>
from ..preprocessing import LabelBinarizer, label_binarize File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/preprocessing/__init__.py", line 25, in <module>
from ._weights import balance_weights ImportError: cannot import name 'balance_weights'