ModuleNotFoundError: No module named 'pyarrow.lib' - python

This is the full error message.
Traceback (most recent call last):
File "C:\Users\adi\OneDrive\Desktop\Python310\machine learning project.py", line 3, in <module>
import streamlit as st
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\__init__.py", line 70, in <module>
from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\delta_generator.py", line 19, in <module>
from streamlit import cursor, caching
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\cursor.py", line 18, in <module>
from streamlit.scriptrunner import get_script_run_ctx
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\scriptrunner\__init__.py", line 16, in <module>
from .script_runner import (
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\scriptrunner\script_runner.py", line 35, in <module>
from streamlit.state import (
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\state\__init__.py", line 27, in <module>
from .session_state_proxy import (
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\state\session_state_proxy.py", line 24, in <module>
from streamlit.type_util import Key
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\type_util.py", line 22, in <module>
import pyarrow as pa
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\pyarrow\__init__.py", line 65, in <module>
import pyarrow.lib as _lib
I am working with streamlit for a project but can't work out this problem.
I have tried uninstalling and reinstalling streamlit but that did'nt help.
i using python 3.8

Uninstalling and re-installing solved the issue for me:
pip uninstall pyarrow
pip install pyarrow
I think I messed things up by changing the Python version in my Conda environment.

You need to install pyarrow
python3 -m pip install pyarrow

Check these 2 things(worked for me) -
1-If you have changed your python version recently, uninstall all libraries then install.(can be done easily by pip uninstall -r requirements.txt -y & then pip install -r requirements.txt -y
2- If you have installed pyarrow in a different environment.

Related

Pip isn't working after downgrading to version 18

I downgraded Pip from the most recent version using sudo python -m pip install pip==18.0 --upgrade, and now I am receiving the following error when running pip/pip3, including when trying to re-upgrade it using pip3 install --upgrade pip
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 5, in \<module\>
from pip.\_internal import main
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/\_internal/__init__.py", line 42, in \<module\>
from pip.\_internal import cmdoptions
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/\_internal/cmdoptions.py", line 16, in \<module\>
from pip.\_internal.index import (
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/\_internal/index.py", line 14, in \<module\>
from pip.\_vendor import html5lib, requests, six
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/\_vendor/html5lib/__init__.py", line 25, in \<module\>
from .html5parser import HTMLParser, parse, parseFragment
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/\_vendor/html5lib/html5parser.py", line 8, in \<module\>
from . import \_tokenizer
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/\_vendor/html5lib/\_tokenizer.py", line 16, in \<module\>
from .\_trie import Trie
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/\_vendor/html5lib/\_trie/__init__.py", line 3, in \<module\>
from .py import Trie as PyTrie
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/\_vendor/html5lib/\_trie/py.py", line 6, in \<module\>
from .\_base import Trie as ABCTrie
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/\_vendor/html5lib/\_trie/\_base.py", line 3, in \<module\>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
Not sure if there's a specific reason you installed pip 18.0 as it looks incompatible with Python 3.10. It looks like in Python 3.10 collections.Mapping moved to collections.abc.Mapping. I would suggest just completely uninstalling pip and reinstalling, without using pip to do so.
In general, you should try to use the latest version of pip.

How can i fix if pip3 is not working after instalation?

I was trying to install matplotlib but first I had to install pip in MobaXterm and I think something failed.
I did:
python -m ensurepip
apt-get install python3-pip
Here I didn't want to, but I closed MobaXterm.
Then I tried starting again and I got:
Found package python3-pip
Package python3-pip is already installed, skipping
But then, when I try to install matplotlib:
pip3 install matplotlib
And I got:
Traceback (most recent call last):
File "/bin/pip3", line 7, in <module>
from pip import main
File "/usr/lib/python3.4/site-packages/pip/__init__.py", line 13, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/usr/lib/python3.4/site-packages/pip/utils/__init__.py", line 22, in <module>
from pip._vendor import pkg_resources, six
File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 36, in <module>
import plistlib
File "/usr/lib/python3.4/plistlib.py", line 65, in <module>
from xml.parsers.expat import ParserCreate
File "/usr/lib/python3.4/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: No such process
Thank you and sorry, I'm really not an experienced programmer.

ImportError: cannot import name 'registry' from 'pandas.core.dtypes.base'

I just did a conda install of a few packages to follow a tutorial, and now I can't even import pandas.
I installed these:
fake-factory==0.7.2
Faker==0.7.3
pytz==2016.7
tzlocal==1.3.0
And now I get this:
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\api.py", line 7, in <module>
from pandas.core.arrays.integer import (
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\arrays\__init__.py", line 2, in <module>
from .base import (ExtensionArray, # noqa
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\arrays\base.py", line 21, in <module>
from pandas.core import ops
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\ops\__init__.py", line 21, in <module>
from pandas.core.construction import extract_array
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\construction.py", line 18, in <module>
from pandas.core.dtypes.base import ExtensionDtype, registry
ImportError: cannot import name 'registry' from 'pandas.core.dtypes.base' (C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\dtypes\base.py)
I tried doing a conda update pandas, but to no avail.
I also just installed luigi, not quite sure when it broke as I installed all the additional packages in one go.
Updated version of pandas package using pip3
try this in python3
pip3 install --upgrade pandas
Try updating pandas package in Anaconda:
conda install pandas=1.1.4
If no luck, try updating all packages:
conda update --all
Worked in my case.

trying to install pyperclip in python2.7

everytime i run this i face this problem
> sudo pip install pyperclip
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
File "/home/ot/.local/lib/python2.7/site-packages/pip/__init__.py", line 26, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/home/ot/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 22, in <module>
from pip.compat import console_to_str, expanduser, stdlib_pkgs
ImportError: No module named compat
ps: im using python 2.7 and this has been happening to me while trying to download other few packages as well
I'm on ubuntu 16.04
Thank you
problem solved i used these 2 lines :
sudo apt-get update
sudo apt-get install python-pyperclip

Jupyter install for Python 2.7 failed

I have the Anaconda distribution of Python 2.7 and I needed to install the Jupyter notebook package. During the installation process my computer turned off and after that I couldn't continue with the process. I tried to uninstall Jupyter and try installing it again, but I keep getting the same error:
Traceback (most recent call last):
File "C:\Users\Acer\Anaconda\Scripts\ipython-script.py", line 3, in <module>
from IPython import start_ipython
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\__init__.py", line 49, in <module>
from .terminal.embed import embed
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\terminal\embed.py", line 19, in <module>
from IPython.terminal.ipapp import load_default_config
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\terminal\ipapp.py", line 22, in <module>
from IPython.core.completer import IPCompleter
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\core\completer.py", line 71, in <module>
from IPython.utils import generics
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\utils\generics.py", line 8, in <module>
from simplegeneric import generic
ImportError: No module named simplegeneric
What should I remove/add in order to make it work?
You need to install the python package simplegeneric. After you install it, you need to install the next package that you fail to import. Continue this process until you dont get any import errors.

Categories