Cannot install the gpu version of torch and torchvision in poetry due to a dependency problem

I am trying to create a virtual environment for machine learning using poetry. So, I am using pytorch as a framework for deep learning. I will extract the relevant part of my pyproject.toml.

python = "^3.8"
torch = { url = ""}
torchvision = { url = "" }

Since pytroch uses the GPU, you need to install it by specifying the whl file. If you install it this way, the version of pytroch will be 1.8.0+cu111. torchvision corresponding to 1.8.0 of pytorch is 0.9.0. The version of pytroch that this torchvision depends on is 1.8.0 (without cu111). Therefore, I cannot create a virtual environment using poetry with the following error.


  Because torchvision (0.8.0) depends on torch (1.7.0)
   and mdwithpriorenergy depends on torch (1.8.0+cu111), torchvision is forbidden.
  So, because mdwithpriorenergy depends on torchvision (0.8.0), version solving failed.

So, because [env name] depends on torchvision (0.8.0), version solving failed. 

I also made the following changes to torchvision in pyproject.toml above, but they did not work.

python = "^3.8"
torch = { url = ""}
- torchvision = { url = ""}
+ torchvision = "*"

In this case, I received the following error


  'EmptyConstraint' object has no attribute 'allows'.

Please tell me how to solve this error.

Are you able to solve this problem? I am facing the same issue.

Have you solve this problem ? I met the same problem now.