I am building an Arch Linux system from scratch, and presently there is no Python in the system. I could install Python2.7 by using this command:
pacman -S python2
But when I try to install some package for python like this:
pacman -S python-numpy
Pacman only shows option to download Python3.x and numpy for Python3.x. There is no other option available. How can I make sure that when I search for Python stuff, it only searches based on which Python version I have installed? There is no Python3 in my system and I have no need of it at all. In my Ubuntu system, I do not specify the Python version but it is always taken care of. I have no clue how to handle this in Arch Linux.
Thanks in advance!
There are several ways to install Python packages on Arch Linux: Official repositories and AUR — A large number of popular packages are available in the Arch repositories. This is the preferred way to install system-wide packages. pip(1) — The official package installer for Python.
How do I Install a Specific Version of a Python Package? To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1.
In Arch Linux the default Python version is 3, so all python-* packages (including python itself) are for Python3. Fortunately Python2 is still fully supported, they are just prefixed with python2-* instead. So to install numpy you would do pacman -S python2-numpy
.
Also if you want to download the packages specific to python2.7 from Python Package Index you'll have to use pip2. e.g.:
sudo pip2 install <package name>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With