Import "pytube" could not be resolved pylance (repotMissingImport) - python

from pytube import Youtube
enter image description here

Based on the information you provided, I reproduced this problem:
Please refer to the following to check the installation process of the module:
If you have multiple python environments, please check whether the VS Code terminal is using the selected python environment (shown in the lower left corner of VS Code), if they are not the same, please open a new VS Code terminal. (python --version)
Install the module "pytube". (pip install pytube)
Check the location of the module: (pip show pytube)
Then, please reload VS Code to make it recognize this moduleļ¼š(F1, Developer: Reload Window)
Reference: Python environment in VS Code.

Your Python interpreter may also be found on the bottom right corner of VS Code

Related

Import "urllib3" could not be resolved from sourcePylancereportMissingModuleSource

I am new to Python and writing a lambda function.
I installed urllib3 using pip but still getting this following error.
I tried restarting vscode/ uninstall and reinstall but still getting the error.
this is the result when I run pip show urllib3
what am i missing here?
You need to make sure that VS Code uses the same Python Interpreter that you installed this package to.
You can see it here:
Looks like yours should point to
c:\user\###\appdata\local\programs\python\python39\bin\python
(or something like that, where your python executable file is located)
Maybe there is more than one python environment on your machine, And the location where you installed the package is inconsistent with the python interpreter you are using now.
You can use CTRL + SHIFT + P to open the command palette and search Python: Select Interpreter (or click on the interpreter version displayed in the lower right corner).
Select the environment interpreter where you have the urllib3 package installed.

Python pyfuglet modules installation

there is some modules that when im trying to install from pypI, like pyfiglet or Django framework, i'll saw some errors. how can i fix it? my python versio is 3.9.4
For installing and checking the python module "pyfiglet" in VS Code, please refer to the following:
Please make sure that python is available, and select the required python environment in the lower left corner of VS Code.
Please use the shortcut key Ctrl+Shift+` to open a new VS Code terminal, and check whether the python used by the terminal is the same as the lower left corner of VS Code: ( python --version )
Then install the module "pyfiglet": (pip install pyfiglet)
Check the installation of this module: (pip show pyfiglet)
Run:
Reference: Getting Started with Python in VS Code and Python environments in VS Code.

vscode & python 3.9.1 - unresolved imports

I'm trying to run a script in python 3.9.1, on mac os, and several modules show a message of unresolved import 'aioboto3'Python(unresolved-import)
I ran pip3 in order to install them, it seems to have installed them but the messages still appear.
vscode does display correct version on the lower left bar.
Please advise on how can I resolve this? or even if this is an issue?
Based on the information you provided, I reproduced the problem:
Please check whether the module "aioboto3" has been installed in the python environment you are using: (pip show aioboto3)
(If it does not display the module installation information, it means that the module is not available in this environment. Please open a new VS Code terminal and make sure that the terminal is using the expected python environment (python --version).)
Please reload VS Code to let it recognize that the module has been installed.
Run:
Reference: Python Environments in VS Code.

How do I import Pandas library into PyCharm?

I have downloaded Pandas library with pip install pandas through the command prompt, when I try to import pandas as pd PyCharm returns an error : ModuleNotFoundError: No module named 'pandas'
I have tried to uninstall and install again many times but nothing seems to work. Does anybody know a solution to this?
You can try downloading the library from PyCharm settings:
File -> Settings
then, Project: -> Python Interpreter
Click a + sign to the right,
Search for the pandas library,
and finally, press 'Install Package'
I think you have to choose the right python interpreter. Check my screenshot
You likely have multiple copies of Python installed on your system. PyCharm can be configured to use any version of Python on your system, including any virtual environments you've defined. The solution is to match up the version of Python you've installed Pandas into with the version of Python that PyCharm is using to run your code.
There are two places where you specify a Python version. First of all, your Project has a version associated with it. Check the "Python Interpreter" section of the "Project" section of your Preferences for that. That version is used for syntax highlighting, code completion, etc.
By default, the abovementioned Python version will also be used to run your code. But you can change the version of Python that your code is run with by creating or modifying a Run Configuration. To do this, check the menu next to the Run and Debug toolbar buttons near the top-left of your PyCharm window.
When you do get into the Python Interpreter section of the Preferences, you'll find that you can see all of the modules installed for each Python version that PyCharm knows about. You can use this to check to see if Pandas is installed for a particular Python version.
I would suggest you get comfortable with all that I've said above. It will save you many headaches in the future.

How do i install a Prject interpeter that cannot be found in the pycharm explorer

I am trying to install the huobi_python lib to my pycharm however i'm unable to do so. I have tried multiple times to add it and google it but did not succseed. Does anyone know how to fix this?
Github link:https://github.com/huobiapi/huobi_Python
Running windows 10, no i cannot find it in Project interpeter and with the + sign. Those are mostly REST api's
You wouldn't add it as an interpreter.
Since the project isn't available as pip install, you'd have to build it from source. Meaning clone the repo, and run the command listed in the installation section from the command prompt. Also make sure that you're using Python3.7, as listed there.
Your interpreter then would have to just be Python 3.7, which will allow you to import the modules from other Python code
from huobi import RequestClient
# your code

Categories

Resources