-1

first I should say that I am newcomer in programming with python , and my problem is I try to make an telegram bot by python in pycharm , I install the telegram and telegram-python-bot package with pip in cmd in terminal of pycharm but when I run my project , the error be shown is the telegram module is not found .

I try to solve this problem with venv base on my friend suggestion but it is not work . I hope u can solve my problem :)

  • Have you tried turning it off and on again? Aka, restart PyCharm. Using a venv is not strictly necessary. – Nils Lindemann Nov 19 '22 at 23:13
  • Depending on how you created your project in PyCharm it may already have its own virtual environment. Instead of using pip in the terminal, go to File -> Settings -> Project -> Python Interpreter, then click the + button to add packages to your project. – nigh_anxiety Nov 19 '22 at 23:15
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 20 '22 at 22:05

1 Answers1

-1
  • You should create a local virtual environment with python3 -m venv venv

  • Configure this Pycharm project to select this environment: Pycharm - Preferences - Project - Python interpreter. Then select the gear, select add; choose this local environment.

  • Quit and reopen your Pycharm project

Then you can install your packages on this environment and it will be recognised by Pycharm

dyna-soar
  • 9
  • 2