Python exe no module named install

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

[Bug]: No module named pip #6260

[Bug]: No module named pip #6260

asking-for-help-with-local-system-issues This is issue is asking for help with issues related to local system; please offer assistance

Comments

Is there an existing issue for this?

What happened?

Any error happening after ‘commit hash : XXXX’ or ‘Installing Torch. ‘ bellow is not related to the launcher please report them on Automatic1111’s github instead :
☁ https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/new/choose
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Cancel
venv «D:\AI\stable-diffusion-webui\venv\Scripts\Python.exe»
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: c0ee148
Installing torch and torchvision
Traceback (most recent call last):
File «D:\AI\stable-diffusion-webui\launch.py», line 294, in
prepare_environment()
File «D:\AI\stable-diffusion-webui\launch.py», line 206, in prepare_environment
run(f'»» -m ‘, «Installing torch and torchvision», «Couldn’t install torch»)
File «D:\AI\stable-diffusion-webui\launch.py», line 49, in run
raise RuntimeError(message)
RuntimeError: Couldn’t install torch.
Command: «D:\AI\stable-diffusion-webui\venv\Scripts\python.exe» -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 —extra-index-url https://download.pytorch.org/whl/cu113
Error code: 1
stdout:
stderr: D:\AI\stable-diffusion-webui\venv\Scripts\python.exe: No module named pip

Читайте также:  5 ballov russianpost ru magic frame corona php

Steps to reproduce the problem

C:\Users\Administrator>python -m ensurepip
Looking in links: c:\Users\ADMINI~1\AppData\Local\Temp\tmpzpu3l19d
ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。
Consider using the —user option or check the permissions.

Traceback (most recent call last):
File «C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py», line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File «C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py», line 86, in run_code
exec(code, run_globals)
File «C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\ensurepip_main
.py», line 5, in
sys.exit(ensurepip.main())
File «C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\ensurepip_init
.py», line 287, in _main
return bootstrap(
File «C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\ensurepip_init
.py», line 203, in _bootstrap
return _run_pip([*args, *PACKAGE_NAMES], additional_paths)
File «C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\ensurepip_init
.py», line 104, in _run_pip
return subprocess.run(cmd, check=True).returncode
File «C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\subprocess.py», line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[‘C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe’, ‘-W’, ‘ignore::DeprecationWarning’, ‘-c’, ‘\nimport runpy\nimport sys\nsys.path = [‘C:\\Users\\ADMINI 1\\AppData\\Local\\Temp\\tmpzpu3l19d\\setuptools-63.2.0-py3-none-any.whl’, ‘C:\\Users\\ADMINI 1\\AppData\\Local\\Temp\\tmpzpu3l19d\\pip-22.2.1-py3-none-any.whl’] + sys.path\nsys.argv[1:] = [‘install’, ‘—no-cache-dir’, ‘—no-index’, ‘—find-links’, ‘C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmpzpu3l19d’, ‘setuptools’, ‘pip’]\nrunpy.run_module(«pip», run_name , alter_sys=True)\n’]’ returned non-zero exit status 1.

What should have happened?

Commit where the problem happens

What platforms do you use to access UI ?

What browsers do you use to access the UI ?

Command Line Arguments

Settings file found, loading ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ → Updating Settings File ✓ SUCCESS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ i Launcher Version 1.5.5 i Python 3.10 path found : C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe i Git found at C:\Program Files\Git i Git is in PATH i Automatic1111 SD WebUI found at D:\AI\stable-diffusion-webui ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Opening A1111 WebUI Launcher ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ i Arguments are now: --xformers --ckpt-dir 'D:\AI\stable-diffusion-webui\models' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ↓ Updating Webui fatal: unable to access 'https://github.com/AUTOMATIC1111/stable-diffusion-webui/': Recv failure: Connection was reset ✓ SUCCESS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ i No extension found in the extensions folder i Arguments are now: --xformers --ckpt-dir 'D:\AI\stable-diffusion-webui\models' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ WEBUI LAUNCHING VIA EMS LAUNCHER, EXIT THIS WINDOW TO STOP THE WEBUI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Any error happening after 'commit hash : XXXX' or 'Installing Torch. ' bellow is not related to the launcher please report them on Automatic1111's github instead : ☁ https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/new/choose ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Cancel venv "D:\AI\stable-diffusion-webui\venv\Scripts\Python.exe" Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Commit hash: c0ee1488702d5a6ae35fbf7e0422f9f685394920 Installing torch and torchvision Traceback (most recent call last): File "D:\AI\stable-diffusion-webui\launch.py", line 294, in prepare_environment() File "D:\AI\stable-diffusion-webui\launch.py", line 206, in prepare_environment run(f'"" -m ', "Installing torch and torchvision", "Couldn't install torch") File "D:\AI\stable-diffusion-webui\launch.py", line 49, in run raise RuntimeError(message) RuntimeError: Couldn't install torch. Command: "D:\AI\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113 Error code: 1 stdout: stderr: D:\AI\stable-diffusion-webui\venv\Scripts\python.exe: No module named pip 请按任意键继续. . .

Additional information, context and logs

Settings file found, loading
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
→ Updating Settings File
✓ SUCCESS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
i Launcher Version 1.5.5
i Python 3.10 path found : C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe
i Git found at C:\Program Files\Git
i Git is in PATH
i Automatic1111 SD WebUI found at D:\AI\stable-diffusion-webui
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Opening A1111 WebUI Launcher
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
i Arguments are now: —xformers —ckpt-dir ‘D:\AI\stable-diffusion-webui\models’
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↓ Updating Webui
fatal: unable to access ‘https://github.com/AUTOMATIC1111/stable-diffusion-webui/’: Recv failure: Connection was reset
✓ SUCCESS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
i No extension found in the extensions folder
i Arguments are now: —xformers —ckpt-dir ‘D:\AI\stable-diffusion-webui\models’
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WEBUI LAUNCHING VIA EMS LAUNCHER, EXIT THIS WINDOW TO STOP THE WEBUI
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Any error happening after ‘commit hash : XXXX’ or ‘Installing Torch. ‘ bellow is not related to the launcher please report them on Automatic1111’s github instead :
☁ https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/new/choose
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Cancel
venv «D:\AI\stable-diffusion-webui\venv\Scripts\Python.exe»
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: c0ee148
Installing torch and torchvision
Traceback (most recent call last):
File «D:\AI\stable-diffusion-webui\launch.py», line 294, in
prepare_environment()
File «D:\AI\stable-diffusion-webui\launch.py», line 206, in prepare_environment
run(f'»» -m ‘, «Installing torch and torchvision», «Couldn’t install torch»)
File «D:\AI\stable-diffusion-webui\launch.py», line 49, in run
raise RuntimeError(message)
RuntimeError: Couldn’t install torch.
Command: «D:\AI\stable-diffusion-webui\venv\Scripts\python.exe» -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 —extra-index-url https://download.pytorch.org/whl/cu113
Error code: 1
stdout:
stderr: D:\AI\stable-diffusion-webui\venv\Scripts\python.exe: No module named pip

The text was updated successfully, but these errors were encountered:

Источник

Решение ошибки «ModuleNotFoundError: No module named ‘…’»

В Python может быть несколько причин возникновения ошибки ModuleNotFoundError: No module named . :

  • Модуль Python не установлен.
  • Есть конфликт в названиях пакета и модуля.
  • Есть конфликт зависимости модулей Python.

Рассмотрим варианты их решения.

Модуль не установлен

В первую очередь нужно проверить, установлен ли модуль. Для использования модуля в программе его нужно установить. Например, если попробовать использовать numpy без установки с помощью pip install будет следующая ошибка:

Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'numpy'

Для установки нужного модуля используйте следующую команду:

pip install numpy # или pip3 install numpy

Или вот эту если используете Anaconda:

Учтите, что может быть несколько экземпляров Python (или виртуальных сред) в системе. Модуль нужно устанавливать в определенный экземпляр.

Конфликт имен библиотеки и модуля

Еще одна причина ошибки No module named — конфликт в названиях пакета и модуля. Предположим, есть следующая структура проекта Python:

demo-project └───utils __init__.py string_utils.py utils.py

Если использовать следующую инструкцию импорта файла utils.py, то Python вернет ошибку ModuleNotFoundError .

 
>>> import utils.string_utils
Traceback (most recent call last):
File "C:\demo-project\utils\utils.py", line 1, in
import utils.string_utils
ModuleNotFoundError: No module named 'utils.string_utils';
'utils' is not a package

В сообщении об ошибке сказано, что «utils is not a package». utils — это имя пакета, но это также и имя модуля. Это приводит к конфликту, когда имя модуля перекрывает имя пакета/библиотеки. Для его разрешения нужно переименовать файл utils.py.

Конфликт зависимостей модулей Python

Иногда может существовать конфликт модулей Python, который и приводит к ошибке No module named.

Следующее сообщение явно указывает, что _numpy_compat.py в библиотеке scipy пытается импортировать модуль numpy.testing.nosetester .

Traceback (most recent call last): File "C:\demo-project\venv\ Lib\site-packages\ scipy\_lib\_numpy_compat.py", line 10, in from numpy.testing.nosetester import import_nose ModuleNotFoundError: No module named 'numpy.testing.nosetester'

Ошибка ModuleNotFoundError возникает из-за того, что модуль numpy.testing.nosetester удален из библиотеки в версии 1.18. Для решения этой проблемы нужно обновить numpy и scipy до последних версий.

pip install numpy --upgrade pip install scipy --upgrade 

Источник

Оцените статью