green-api / whatsapp-api-client-python

This library helps you easily create a Python application with WhatsApp API.
https://green-api.com/en
Other
137 stars 35 forks source link

Does not find the module #59

Closed surgutandrey closed 1 month ago

surgutandrey commented 1 month ago

{ "name": "ModuleNotFoundError", "message": "No module named 'whatsapp_api_client_python'", "stack": "--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 1 ----> 1 from whatsapp_api_client_python import API 2 from datetime import datetime, timedelta 3 from telegram import Bot

ModuleNotFoundError: No module named 'whatsapp_api_client_python'" }

Smol2022 commented 1 month ago

Thank you for contacting us. Your request has been forwarded to the developers, please wait, we will return with an answer.

astashenkoj commented 1 month ago

It looks like you're encountering a ModuleNotFoundError when trying to import the 'whatsapp_api_client_python' module. This error occurs when Python can't find the specified module in its search path. To resolve this issue, you need to install the required package. Here are the steps you can follow:

First, make sure you have pip installed and updated.

Then, try installing the package using pip. Open your terminal or command prompt and run: pip install whatsapp-api-client-python

If that doesn't work, you might need to check if the package name is correct. Sometimes, the import name differs from the installation name. You could try searching for the correct package name on PyPI (Python Package Index).

If you're using a virtual environment, ensure that you're activating it before installing the package. After installation, restart your Python interpreter or Jupyter notebook kernel if you're using one.If you're still facing issues after trying these steps, it would be helpful to know: Which environment are you running this in? (Jupyter notebook, Python script, etc.)

Are you using any virtual environment? What's the output when you run pip list in your terminal?This information could help in troubleshooting further if the problem persists.

surgutandrey commented 1 month ago

using any virtual environment "venv" and Jupyter notebook

astashenkoj commented 1 month ago

In a virtual environment like Jupiter, install the module only with ! at first: !pip install whatsapp-api-client-python

surgutandrey commented 1 month ago

I did the installation using the command: python -m pip install whatsapp-api-client-python

The following command fails: !pip install whatsapp-api-client-python

I use the Windows IDE: vs_code. Environment: venv and Jupiter notebook

When entering the "pip list" command, it shows: whatsapp-api-client-python 0.0.46

and in the import team from whatsapp_api_client_python import API

Note that in one case the underscores are lower and in the other they are not.

AnnaVas1leva commented 1 month ago

We tested the installation on our devices, but we were unable to reproduce your error even when using venv. Please make sure you only have one version of Python installed on your device, this can also cause the problem with installation