I am having my first try at Python. I am working in Artix ( Arch based)
Python is installed by default
$ python
Python 3.13.3 (main, Apr 9 2025, 17:13:31) [GCC 14.2.1 20250207] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
I need to use some libraries from pandas
>>> import pandas as pd
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
I guess I need to install pandas first?
The documentation says I can install it with Anaconda
( what is that?) or from PyPI
(what is that?) using pip
.
I chose the latter
I found out what PyPI is
" PyPI, short for Python Package Index, is the official third-party package repository for the Python programming language. It is a central repository that hosts and distributes software packages for Python developers to use. Developers can upload Python packages to PyPI where they can be easily accessed by others.
"
Now where is âpipâ?
trinity:[nevj]:~/juliawork/dermis.collagen.images$ which pip
which: no pip in (/usr/bin/vendor_perl/:/home/nevj/.juliaup/bin:/usr/local/bin:
/usr/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/
bin/vendor_perl:/usr/bin/core_perl:/common/bin)
OK I need to install pip
# pacman -Ss pip
...
world/python-pip 25.0.1-1
The PyPA recommended tool for installing Python packages
...
# pacman -Syu
# pacman -S python-pip
....
(8/8) installing python-pip
Now I try to use pip
to install pandas
$ pip install pandas
error: externally-managed-environment
Ă This environment is externally managed
â°â> To install Python packages system-wide, try 'pacman -S
python-xyz', where xyz is the package you are trying to
install.
If you wish to install a non-Arch-packaged Python package,
create a virtual environment using 'python -m venv path/to/venv'.
Then use path/to/venv/bin/python and path/to/venv/bin/pip.
If you wish to install a non-Arch packaged Python application,
it may be easiest to use 'pipx install xyz', which will manage a
virtual environment for you. Make sure you have python-pipx
installed via pacman.
I tried again as root ⌠no luck
I tried using pipx
⌠no luck
So I gave up on pip and used pacman to install pandas
$ pacman -Ss pandas
world/python-pandas 2.2.3-1
High-performance, easy-to-use data structures and data analysis tools for
Python
world/python-pandas-datareader 0.10.0-5
Data readers extracted from the pandas codebase
world/python-numexpr 2.10.2-1
Fast numerical array expression evaluator for Python, NumPy, PyTables,
pandas
# pacman -S python-pandas
resolving dependencies...
....
That works
>>> import pandas as pd
>>>
>>> df = pd.read_csv('expt1.csv')
>>> df
Farm Grade Sheep ... Green Blue Count
0 Glensloy smooth 3457 ... 0.304495 0.263945 732
1 Glensloy smooth 3457 ... 0.233286 0.481588 41
2 Glensloy smooth 3457 ... 0.285897 0.311324 374
3 Glensloy smooth 3457 ... 0.232893 0.303401 49
4 Glensloy smooth 3457 ... 0.204372 0.245076 87
I can import pandas and use pd.read_csv
function
OK, I found a workaround
but
Question : What does this message mean
error: externally-managed-environment
Why is Artix stopping me from using pip
and insisting I use the package system?