1

I am trying to install the urllib2 module in Arch Linux as I need to run a Python code.

The error that the Python code outpus is:

File "PiMiner/PiMiner.py", line 3, in <module>
import sys, subprocess, time, urllib2, socket

Now, when I runt his code sudo pacman -S urllib2, I get error: target not found: urllib2

What can I do in this situation?

Andrei RRR
  • 3,068
  • 16
  • 44
  • 75
  • What Python version are you using? If 2.x, then `urllib2` does not need to be installed, it's a standard module. If 3.x, then you need to change the imports [accordingly](http://docs.python.org/3/library/urllib.html). – Lev Levitsky Dec 19 '13 at 20:53

2 Answers2

4

In ArchLinux, the command python defaults to python3. If you neeed to use 2.x, you should run the script with python2 whatever.py.

Frank Riccobono
  • 1,043
  • 6
  • 13
1

As aelfric5578 said, python defaults to python3

But if you wish to run it with python3 then you can search the Arch repos with pacman -Ss urllib which will a return a list of packages you can pacman -S

As a naming scheme, Arch sticks to python-libname for python 3 or python2-libname for python2, so it's usually a safe bet to pacman -S python-missinglib