在Arch Linux中安装urllib2(Install urllib2 in Arch Linux)

我正在尝试在Arch Linux中安装urllib2模块,因为我需要运行Python代码。

Python代码输出的错误是:

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

现在,当我用他的代码sudo pacman -S urllib2 ,我得到error: target not found: urllib2

在这种情况下我该怎么办?

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?

最满意答案

在ArchLinux中,命令python默认为python3 。 如果你需要使用2.x,你应该使用python2 whatever.py运行脚本。

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

更多推荐