How do I import modules in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I import modules in python

I want to import pytube in the code playground some how is not working.

6th Jan 2022, 7:06 AM
Abdiqani Mohamed
Abdiqani Mohamed - avatar
6 Answers
+ 3
Solomoni Railoa Oh thanks so much. So I suggest he use Pycharm or Vs Code.
6th Jan 2022, 7:19 AM
Cyber Nate
Cyber Nate - avatar
+ 2
Solomoni Railoa thank you for your answer.
6th Jan 2022, 7:21 AM
Abdiqani Mohamed
Abdiqani Mohamed - avatar
+ 1
your first line of code must be import pytube as pt that's how you import pytube in your python code.
6th Jan 2022, 7:11 AM
Cyber Nate
Cyber Nate - avatar
+ 1
Install pycharm or visual studio The open you windows command prompt and install the module you want If you have no laptop or PC You can install pydroid it's an Android application it provide terminal for you Just python -m pip install 'module_name'
7th Jan 2022, 9:01 PM
bakeery
0
You can use external modules in SoloLearn virtual env. You have to install them with pip via os module to avoid typing in terminal. import os os.system('pip install pytube --quiet') import pytube
6th Jan 2022, 7:26 AM
RaiRoko
RaiRoko - avatar
0
Скачиваешь pip.py, вводишь в командую строку get-pip.py, затем pip install и имя модуля
7th Jan 2022, 9:12 PM
Nikita Zavertkin
Nikita Zavertkin - avatar