Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'pkg_resources' #390

Open
spikeyhair opened this issue Mar 28, 2024 · 5 comments
Open

ModuleNotFoundError: No module named 'pkg_resources' #390

spikeyhair opened this issue Mar 28, 2024 · 5 comments

Comments

@spikeyhair
Copy link

spikeyhair commented Mar 28, 2024

I tried to install in Win10 and I am stucked at the step where it ask me to run this command:
python3 -m uiautomator2 init

I am getting this error:
C:\Users\kckw_\OneDrive\Python Projects\gramaddict\venv>python -m uiautomator2 init
Traceback (most recent call last):
File "", line 189, in run_module_as_main
File "", line 148, in get_module_details
File "", line 112, in get_module_details
File "C:\Users\kckw
\AppData\Roaming\Python\Python312\site-packages\uiautomator2_init
.py", line 40, in
import adbutils
File "C:\Users\kckw
\AppData\Roaming\Python\Python312\site-packages\adbutils_init_.py", line 12, in
from .adb import AdbConnection
File "C:\Users\kckw
\AppData\Roaming\Python\Python312\site-packages\adbutils_adb.py", line 16, in
from adbutils.utils import adb_path
File "C:\Users\kckw
\AppData\Roaming\Python\Python312\site-packages\adbutils_utils.py", line 15, in
from pkg_resources import resource_filename
ModuleNotFoundError: No module named 'pkg_resources'

I found that pkg_resources is actually available at
C:\Users\kckw_\OneDrive\Python Projects\gramaddict\venv\Lib\site-packages\pip_vendor
and
C:\Program Files\Python312\Lib\site-packages\pip_vendor

this is the path I set:
PATH=C:\Program Files\Python312\Scripts;C:\Program Files\Python312;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Users\kckw_\AppData\Local\Microsoft\WindowsApps;C:\Users\kckw_\AppData\Local\atom\bin;C:\Users\kckw_\OneDrive\Python Projects\gramaddict\platform-tools;C:\Users\kckw_\OneDrive\Python Projects\gramaddict\virtualspace\Lib\site-packages;C:\Users\kckw_\OneDrive\Python Projects\gramaddict\venv\Lib\site-packages\pip_vendor;

I tried to uninstall python, deleted the virtual env and start from the first step again. I am still hitting this error.
Please help. Thanks.

@mastrolube
Copy link
Contributor

Maybe uiautomator2 (or one of his dependencies) doesn't support python 3.12. Have you tried to use a previous version of python? I suggest you 3.10

@tien6193
Copy link

tien6193 commented Apr 1, 2024 via email

@tien6193
Copy link

tien6193 commented Apr 1, 2024 via email

@Szymok
Copy link

Szymok commented Jun 28, 2024

Right, just run pip3 install --upgrade setuptools

@G6KG
Copy link

G6KG commented Oct 24, 2024

Step 1: Install Python 3.9 (if not already installed)
Check if Python 3.9 is installed:

python3.9 --version
If it’s not installed, install Python 3.9 using one of the following methods:

Step 2: Create a Virtual Environment
Navigate to your project directory:

cd /path/to/your/project
Create a virtual environment named venv:

python3.9 -m venv venv
Activate the virtual environment:

On Linux/macOS:

source venv/bin/activate
On Windows:

venv\Scripts\activate

Step 3: Install GramAddict Package

Install GramAddict using pip:

pip install GramAddict

Verify the installation:

pip show GramAddict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants