Python Forum
Problem with importing python-telegram library into the project - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Problem with importing python-telegram library into the project (/thread-38578.html)



Problem with importing python-telegram library into the project - gandonio - Oct-31-2022

Hello. I'm having trouble importing the python-telegram library into my project. I installed it with the command pip install python-telegram, and the installation was successful, but when I try to use this lib by writing in pycharm "from telegram.client import Telegram" (as stated in the documentation), pycharm says that there is no Telegram class in telegram.client. What can help? Python version 3.10.7, Windows operating system.


RE: Problem with importing python-telegram library into the project - deanhystad - Nov-01-2022

You should not be using pip to import libraries when using pycharm. Pycharm has a different way to install.

https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html

https://www.jetbrains.com/pycharm/guide/tips/install-and-import/#:~:text=Type%20the%20name%20of%20the,according%20to%20your%20project%20styles.

You can open a terminal and do a pip install, but you REALLY need to make sure that you activate the SAME virtual environment that is used by PyCharm.