Error no matching distribution found for torch

It seems that this error is also a problem when installing from other sources, such as in #5021. Issue description After lots of debugging and trial and error, we have run into a bug with pipenv re...

It seems that this error is also a problem when installing from other sources, such as in #5021.

Issue description

After lots of debugging and trial and error, we have run into a bug with pipenv relating to installing libraries while using another index url (—extra-index-url).

When trying to install PyTorch using the following command pipenv install --extra-index-url https://download.pytorch.org/whl/cu113/ "torch==1.11.0+cu113" Installing torch==1.11.0+cu113, as specified under this issue: #4961, we get the following error: ERROR: No matching distribution found for torch==1.11.0+cu113.

According to @Bananaman this was possible to do in a previous version of pipenv.

Expected result

Expected an installation using a 3rd party index url, in this case PyTorch.

Actual result

daniel@daniel-desktop:~/Documents$ pipenv install --extra-index-url https://download.pytorch.org/whl/cu113/ "torch==1.11.0+cu113"
Installing torch==1.11.0+cu113...
Adding torch to Pipfile's [packages]...
✔ Installation Succeeded 
Pipfile.lock (db4242) out of date, updating to (7d86a3)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✘ Locking Failed! 

CRITICAL:pipenv.patched.notpip._internal.resolution.resolvelib.factory:Could not find a version that satisfies the requirement torch==1.11.0+cu113 (from versions: 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0)
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 743, in _main
[ResolutionFailure]:       resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 704, in resolve_packages
[ResolutionFailure]:       results, resolver = resolve(
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 685, in resolve
[ResolutionFailure]:       return resolve_deps(
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1398, in resolve_deps
[ResolutionFailure]:       results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1127, in actually_resolve_deps
[ResolutionFailure]:       resolver.resolve()
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/utils.py", line 905, in resolve
[ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: No matching distribution found for torch==1.11.0+cu113

Steps to replicate

Be sure to use the latest version of pipenv, if I use a previous version (latest confirmed is 2022.1.8) the error goes away.

  1. Create clean environment
  2. pipenv install --extra-index-url https://download.pytorch.org/whl/cu113/ "torch==1.11.0+cu113"
  3. Error should appear on latest version of pipenv

$ pipenv —support

Pipenv version: '2022.3.28'

Pipenv location: '/home/daniel/.local/lib/python3.8/site-packages/pipenv'

Python location: '/usr/bin/python3'

Python installations found:

  • 3.8.12: /home/daniel/.pyenv/versions/3.8.12/bin/python
  • 3.8.10: /usr/bin/python3
  • 3.8.10: /usr/bin/python3.8
  • 3.8.10: /bin/python3
  • 3.8.10: /bin/python3.8

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.8.10',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.13.0-37-generic',
 'platform_system': 'Linux',
 'platform_version': '#42~20.04.1-Ubuntu SMP Tue Mar 15 15:44:28 UTC 2022',
 'python_full_version': '3.8.10',
 'python_version': '3.8',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • SESSION_MANAGER
  • QT_ACCESSIBILITY
  • COLORTERM
  • PYENV_SHELL
  • XDG_CONFIG_DIRS
  • XDG_MENU_PREFIX
  • GNOME_DESKTOP_SESSION_ID
  • MANDATORY_PATH
  • LC_ADDRESS
  • GNOME_SHELL_SESSION_MODE
  • LC_NAME
  • SSH_AUTH_SOCK
  • XMODIFIERS
  • DESKTOP_SESSION
  • LC_MONETARY
  • SSH_AGENT_PID
  • GTK_MODULES
  • PWD
  • LOGNAME
  • XDG_SESSION_DESKTOP
  • XDG_SESSION_TYPE
  • GPG_AGENT_INFO
  • XAUTHORITY
  • GJS_DEBUG_TOPICS
  • WINDOWPATH
  • HOME
  • USERNAME
  • IM_CONFIG_PHASE
  • LC_PAPER
  • LANG
  • LS_COLORS
  • XDG_CURRENT_DESKTOP
  • VTE_VERSION
  • GNOME_TERMINAL_SCREEN
  • INVOCATION_ID
  • MANAGERPID
  • GJS_DEBUG_OUTPUT
  • LESSCLOSE
  • XDG_SESSION_CLASS
  • SETUPTOOLS_USE_DISTUTILS
  • TERM
  • LC_IDENTIFICATION
  • DEFAULTS_PATH
  • LESSOPEN
  • USER
  • GNOME_TERMINAL_SERVICE
  • DISPLAY
  • SHLVL
  • LC_TELEPHONE
  • QT_IM_MODULE
  • LC_MEASUREMENT
  • LD_LIBRARY_PATH
  • XDG_RUNTIME_DIR
  • PYENV_ROOT
  • LC_TIME
  • JOURNAL_STREAM
  • XDG_DATA_DIRS
  • PATH
  • GDMSESSION
  • DBUS_SESSION_BUS_ADDRESS
  • LC_NUMERIC
  • OLDPWD
  • _
  • PIP_SHIMS_BASE_MODULE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/daniel/.pyenv/shims:/home/daniel/.pyenv/bin:/usr/local/cuda-11.3/bin:/home/daniel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/daniel/Documents

#1 2021-12-17 18:33:22

TheMacDads
Member
Registered: 2020-05-11
Posts: 9

[SOLVED] Help with Installing Pytorch?

Hi, extra newbie question today. I’m simply trying to install PyTorch in a virtual environment, which is managed by virtualenv/virtualenvwrapper. Pretty fresh arch linux machine.

I’ve installed this package:
https://archlinux.org/packages/communit … n-pytorch/

I hoped that this would provide PyTorch, but no luck. I’ve created a new virtual environment, which pip and which python are correctly pointing to the environment’s pip and python binaries, but pip install torch returns

ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

I assumed that the arch package above would provide pytorch to my pip installation but maybe I’m missing something.

PS: Really I’m after torch v1.9.0, which is now legacy, so any help on which package is required for that or if that’s a lost cause would be great.

Thanks

Last edited by TheMacDads (2021-12-27 19:34:32)

#2 2021-12-17 19:48:14

teckk
Member
Registered: 2013-02-21
Posts: 467

Re: [SOLVED] Help with Installing Pytorch?

#3 2021-12-17 20:08:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 27,833
Website

Re: [SOLVED] Help with Installing Pytorch?

You installed the repo package, so you can just use it by «import»ing the relevant bit in your python code.

In contrast, if you want to install it via pip (with the —user flag) then the repo package is irrelevant, pip downloads and installs from PyPi, in which case you need to use the PyPi package name not the arch linux repo package name.  According to the upstream instructions this would be:

pip3 install torch torchvision torchaudio

Of course you don’t need the «3» on pip, and you would need the «—user» flag, but the package names are there — there is no «pytorch», just «torch» and the others listed.  You can also generally include the version you want, e.g., «torch=1.9.0».

See here for package names and available versions for pip installs: https://pytorch.org/

Last edited by Trilby (2021-12-17 20:11:38)


«UNIX is simple and coherent…» — Dennis Ritchie, «GNU’s Not UNIX» —  Richard Stallman

#4 2021-12-17 21:21:30

Morn
Member
Registered: 2012-09-02
Posts: 863

Re: [SOLVED] Help with Installing Pytorch?

TheMacDads wrote:

PS: Really I’m after torch v1.9.0, which is now legacy, so any help on which package is required for that or if that’s a lost cause would be great.

You can get older package versions from the Arch archive, 1.9.0 is there: https://archive.archlinux.org/packages/ … n-pytorch/

Just remember to add it to your «IgnorePkg» line in /etc/pacman.conf, as otherwise pacman will want to upgrade it immediately.

Last edited by Morn (2021-12-17 21:22:11)

#5 2021-12-27 19:32:56

TheMacDads
Member
Registered: 2020-05-11
Posts: 9

Re: [SOLVED] Help with Installing Pytorch?

Thank you for your responses. In this case, the issue was actually that pytorch is not available for the latest release of Python (3.10). I used pyenv to install Python 3.9.9, created a new virtualenv using that executable, and was then able to pip install the desired pytorch version

#6 2021-12-27 22:08:19

teckk
Member
Registered: 2013-02-21
Posts: 467

Re: [SOLVED] Help with Installing Pytorch?

You sure? I just updated today.

pacman -Ss torch
community/python-pytorch 1.10.0-7
    Tensors and Dynamic neural networks in Python with strong GPU acceleration (with
    AVX2 CPU optimizations)
community/python-pytorch-cuda 1.10.0-7
    Tensors and Dynamic neural networks in Python with strong GPU acceleration (with
    CUDA and AVX2 CPU optimizations)
    
python --version
Python 3.10.1

#7 2021-12-27 22:50:23

TheMacDads
Member
Registered: 2020-05-11
Posts: 9

Re: [SOLVED] Help with Installing Pytorch?

I was attempting to install from pip, so from the Pypi repository. I think they may not host this version yet.

I would only like this to be installed in a virtual environment, not system-wide, so I don’t think the arch repository’s version is suitable for my needs but may be wrong about how this works

#8 2022-01-05 19:29:39

jamesjohnson1097
Member
Registered: 2015-10-15
Posts: 6

Re: [SOLVED] Help with Installing Pytorch?

Hi, I am facing the same issue. Python3.10 is not supported for pytorch. The installation in arch linux will go smooth. However, python3.10 is not suitable for pytorch. One such instance is

https://discuss.pytorch.org/t/dataloade … s/139472/5

Is there an option to tell pacman to use specific python version. If so, please tell me how to do it.

#9 2022-01-05 20:09:32

TheMacDads
Member
Registered: 2020-05-11
Posts: 9

Re: [SOLVED] Help with Installing Pytorch?

I don’t think telling pacman about your python version is a good idea. I recommend using a virtual environment, which is good practice anyway with python. See virtualenvwrapper, which is a nice interface to virtualenv. You can make a new virtual environment using a specific python version. I recommend using pyenv to automate installing a legacy python3.9 version from source (I used 3.9.9). Then make a virtual environment which uses that binary (mkvirtualenv -p /path/to/binary) and then try to pip install torch. These steps worked for me last week

#10 2022-01-05 20:13:16

TheMacDads
Member
Registered: 2020-05-11
Posts: 9

Re: [SOLVED] Help with Installing Pytorch?

Or if you prefer to not use a virtual environment I think teckk’s original answer may be more useful for you

#11 2022-01-05 20:31:15

jamesjohnson1097
Member
Registered: 2015-10-15
Posts: 6

Re: [SOLVED] Help with Installing Pytorch?

Hi, Thank you for the immediate reply. I have tried what you suggested but didn’t work out. My kernel version is `5.15.12-arch1-1′. When i try to install nvidia and cuda using pacman, the versions are nvidia 495.46 and Cuda version 11.5. If you notice, pytorch supports until CUDA 11.3. I have done enough googling to downgrade the cuda version from 11.5 to 11.3 and tried to install the downgraded versions, however every time you downgrade it, there are some incompatible issues and my screen becomes black.

After quite some time in googling and when i ran out of options, i settled on pacman’s packages for nvidia, and cuda rather than installing manually. Now upon settling on pacman’s package and if i use virtualenv and try to install pytorch using pip,  torch says

   ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
   ERROR: No matching distribution found for torch

The above error are due to incompatible drivers of cuda and nvidia.   Is there any solution that you can suggest? please help me. I am completely stuck.

#12 2022-01-05 20:38:00

jamesjohnson1097
Member
Registered: 2015-10-15
Posts: 6

Re: [SOLVED] Help with Installing Pytorch?

I am still not clear. Pytorch community clearly stated that currenlty it doesn’t support Python 3.10.

Link https://discuss.pytorch.org/t/dataloade … ols/139472

Then why is this package available  for python3.10 ?

#13 2022-01-06 22:12:12

TheMacDads
Member
Registered: 2020-05-11
Posts: 9

Re: [SOLVED] Help with Installing Pytorch?

I recall setting up cuda-enabled pytorch to be quite tough in itself to be honest. I believe I used this series of packages from the AUR, but this is probably what you have tried already:

https://archlinux.org/packages/communit … orch-cuda/

I can say that the error messages that you have shown are the same as the ones I was receiving when I was using my Python 3.10 environment, so if you are still using Python 3.10 and pip I would recommend using a 3.9 version at least. If none of this is helpful you probably want to start a new thread which is more focused on Cuda and installing legacy Cuda for pytorch. I’m afraid it’s not something I am familiar with

Best of luck!

0 / 0 / 0

Регистрация: 15.09.2022

Сообщений: 59

1

05.12.2022, 15:02. Показов 1228. Ответов 5


решил установить Novel Ai, мне выдало следующее:
venv «D:моя ерундаstable-diffusion-webuivenvScriptsPython.exe»
Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]
Commit hash: 44c46f0ed395967cd3830dd481a2db759fda5b3b
Installing torch and torchvision
Traceback (most recent call last):
File «D:моя ерундаstable-diffusion-webuilaunch.py», line 294, in <module>
prepare_enviroment()
File «D:моя ерундаstable-diffusion-webuilaunch.py», line 206, in prepare_enviroment
run(f'»{python}» -m {torch_command}’, «Installing torch and torchvision», «Couldn’t install torch»)
File «D:моя ерундаstable-diffusion-webuilaunch.py», line 49, in run
raise RuntimeError(message)
RuntimeError: Couldn’t install torch.
Command: «D:моя ерундаstable-diffusion-webuivenvScriptspython.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: Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113

stderr: ERROR: Could not find a version that satisfies the requirement torch==1.12.1+cu113 (from versions: none)
ERROR: No matching distribution found for torch==1.12.1+cu113

[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: D: stable-diffusion-webuivenvScriptspython.exe -m pip install —upgrade pip

Это значит,что мне обновить что-то надо?Сама папка с питоном не на диске Д находится,если что

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



Автоматизируй это!

Эксперт Python

6481 / 4174 / 1140

Регистрация: 30.03.2015

Сообщений: 12,325

Записей в блоге: 29

05.12.2022, 15:18

2

Lebed300, это значит что тебе почитать надо. например доку торча с какой версией питона он работает, подозреваю что не 3.11



0



0 / 0 / 0

Регистрация: 15.09.2022

Сообщений: 59

05.12.2022, 18:01

 [ТС]

3

Welemir1, Хорошо,сейчас попробую

Добавлено через 2 часа 28 минут
Welemir1, не получилось,читал,что 3.8 <= версия подходит,но при запуске батника пишет,что нужен 3.11,что в этом случае делать?



0



Автоматизируй это!

Эксперт Python

6481 / 4174 / 1140

Регистрация: 30.03.2015

Сообщений: 12,325

Записей в блоге: 29

05.12.2022, 18:12

4

Цитата
Сообщение от Lebed300
Посмотреть сообщение

при запуске батника пишет,что нужен 3.11,что в этом случае делать?

в этом случае надо рассказать что за батник и приложить весь текст ошибки



0



0 / 0 / 0

Регистрация: 15.09.2022

Сообщений: 59

05.12.2022, 19:53

 [ТС]

5

Welemir1, вот батник вместе со всеми файлами взял отсюда (webui-user.bat)
https://github.com/AUTOMATIC11… 0651049173
А то,что я скидывал выше и есть весь текст…

Добавлено через 26 минут
Welemir1, Я еще немного почитал,другая версия питона должна(https://rentry.org/voldy#-troubleshooting-) работать,попробую сейчас еще пошаманить как-нибудь

Добавлено через 1 час 10 минут
Welemir1, Все сделал,прикол оказался в версии питона,я смог запустить,но потом оказалось,что мой комп не способен потянуть это,либо какие-то ошибки у них были…



0



0 / 0 / 0

Регистрация: 18.08.2011

Сообщений: 11

06.01.2023, 00:15

6

Попробуй в файле запуска добавить настройку
set COMMANDLINE_ARGS=—opt-split-attention —precision full —no-half —medvram —skip-torch-cuda-test



0



We will go through how to install the popular Stable Diffusion software AUTOMATIC1111 on Windows step-by-step.

Stable Diffusion is a text-to-image AI that can be run on consumer-grade PC with a GPU. After this tutorial, you will be able to generate AI images on your own PC.

Contents

  • Systems requirements
  • Installation steps
    • Step 1: Install python
    • Step 2: Install git
    • Step 3: Clone web-ui
    • Step 4: Download model file
    • Step 5: Run webui
  • Options
  • Next Step
  • Frequently Asked Questions

Systems requirements

Your PC should be running Windows 10 or higher with a discrete Nvidia video card (GPU) with 4 GB VRAM or more. An integrated GPU will not work.

If your PC does not meet these requirements, alternatives are

  • Cloud service – Google Colab.
  • Mac Apple Silicon M1/M2.

Installation steps

Step 1: Install python

You will need Python 3.10.6 to run Stable Diffusion. Select 64-bit windows installer, or use this direct download link.

windows installer for Python.

Download Python Windows installer.

Open the Python installer to start install.

Make sure “Add Python 3.10 to PATH” is checked. Click “Install Now” to start install.

If you encounter error, it’s most likely because you have previously installed Python. Remove any previously installed Python versions before re-installing 3.10.6. You can do that in Control PanelAdd or remove programs.

Step 2: Install git

Git is a code repository management system. You will need it to install and update AUTOMATIC1111.

Go to this page to download the windows version.

Open the installer. Click Install to accept the license and install the software.

Follow the instruction to complete the install.

Step 3: Clone web-ui

This is the most difficult step…

Press the Window key (Should be on the left of the space bar on your keyboard), a search window should pop up. Type cmd.

Click on Command Prompt. The command prompt window would show up.

First make sure you are in your home folder by typing the following command and press Enter. (Tip: You should be able to use right click to paste in Command Prompt.)

cd %userprofile%

You should see your prompt shows something like C:UsersYOUR_USER_NAME>.

Next type the following command and press Enter to clone the AUTOMATIC1111 repository.

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

A folder called stable-diffusion-webui should be created in your home directory.

It’s ok to clone the repository in a different folder instead of %userprofile%, as long as you can find the newly created stable-diffusion-webui folder. You will need to change the folder location accordingly in the following steps.

Step 4: Download model file

Next, go to the newly created folder in File Explorer. Put in

%userprofile%stable-diffusion-webui

in the address bar and press enter.

Navigate to the folder models and then Stable-diffusion. You should see a file Put Stable Diffusion checkpoints here.txt like below.

Download the Stable Diffusion v1.5 model checkpoint file (download link). Put it in that folder.

Step 5: Run webui

Now in File Explorer, go back to the stable-diffusion-webui folder. That is go back up two levels, or type

%userprofile%stable-diffusion-webui

again in the address bar.

Find a file called webui-user.bat. Double click to run and complete the install.

This last step is going to take a while. When it is done, you will see a message

Running on local URL: http://127.0.0.1:7860

like below.

In your web browser, go to the URL

http://127.0.0.1:7860/

You should see the AUTOMATIC1111 webui! Put in a prompt (e.g. “a cat”) and hit Generate to test if Stable Diffusion is running correctly.

When you are done using Stable Diffusion, close the cmd black window to shut down Stable Diffusion.

To run Stable Diffusion again, you just need to double click the webui-user.bat.

Options

You should be able to speed up Stable Diffusion with the --xformers option. If you have less than 8 GB VRAM on GPU, it is a good idea to turn on --medvram option to conserve memory, so that you can generate more images at a time.

To enable them, right click on the file webui-user.bat and select Edit. (You may need to select “Show more Options” first if you are using Windows 11).

Replace the line

set COMMANDLINE_ARGS=

With

set COMMANDLINE_ARGS=--xformers --medvram

Save and close the file.

Double click the webui-user.bat file to run Stable Diffusion.

Next Step

That’s it! Hope you will have fun making AI images.

If you are new to Stable Diffusion, check out the Quick Start Guide for some quick tips to use Stable Diffusion.

Head to our beginner’s series to learn Stable Diffusion step by step.

Check out this prompt generator for building high-quality prompts.

Frequently Asked Questions

Does it work on AMD GPU?
No, you have to have an NVIDIA GPU.

Is there a easier way to install AUTOMATIC1111?
The above are from the official install instructions. Two alternatives:

  • Recently they started to tag release builds. They are supposed to work after download and unzip.
  • There’s an unofficial easy installer for Windows you can try.

I tried everything but still does not work.
You can use Google Colab to run AUTOMATIC1111. In fact this is what I use most of the time. The notebook launches AUTOMATIC1111 with 1 mouse click.

Buy Me A Coffee

Понравилась статья? Поделить с друзьями:
  • Error not null constraint failed
  • Error not launcher gta 5
  • Error none mapped
  • Error not found physx driver ок
  • Error not found dart html