Search code examples
pythonlinuxurllib2archlinux

Install urllib2 in Arch Linux


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?


Solution

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