WSL-Distribution-Switcher icon indicating copy to clipboard operation
WSL-Distribution-Switcher copied to clipboard

ImportError: No module named request when running get-prebuilt.py

Open J4ckz0n opened this issue 7 years ago • 6 comments

I followed all steps according to https://www.kali.org/tutorials/kali-on-the-windows-subsystem-for-linux/ But when I get to the get-prebuild.py phase I get the following.

C:\WSL-Distribution-Switcher>python get-prebuilt.py kalilinux/kali-linux-docker Traceback (most recent call last): File "get-prebuilt.py", line 7, in import urllib.request ImportError: No module named request

What am I doing wrong here?

KR

J4ckz0n avatar Jan 23 '18 22:01 J4ckz0n

Try installing requests: pip install requests

ghost avatar Jan 30 '18 14:01 ghost

You also need to set the right paths and stuff so the env can find python and the manually added modules

ghost avatar Jan 30 '18 14:01 ghost

hi i have the same problem tried installing requests pip is ok how do i set the patchs and env and modules?

rossdaboss avatar Feb 03 '18 08:02 rossdaboss

its same here

SecFathy avatar Feb 12 '18 16:02 SecFathy

change import from urllib.request to urllib. that fixed this error for me.

iXPert12 avatar Mar 02 '18 05:03 iXPert12

This is likely because you have python version 2 in your path before version 3.

You could remove python 2 from the path or put it after python 3 in the path, however, the *.py scripts are written in a way such that you can run them without the leading python command and it knows to use python 3. i.e. just run "get-prebuilt.py kalilinux/kali-linux-docker" - no leading "python "

JohnnyArson avatar Mar 15 '18 04:03 JohnnyArson