Search code examples
pythonpippytorchcondaallennlp

Pip is uninstalling pytorch built from source when i use 'pip install <some other package that needs pytorch>'. Is there a way?


I needed to build pytorch from source in order to use the latest cuda toolkit - hence I did that. My environment is a conda enviornment.

The package I am trying to install is allennlp.

Pip list is not showing torch installed, conda is showing it is. Tried building allennlp from source through:

conda skeleton pypi <package>
conda build <package>

conda build is also causing problems due to incompability with pip packages etc...

I am just wondering if there is a simpler way to do this?

For example: Tell pip that torch is already installed so it stops uninstalling the current torch (why can't it just pick it up as installed). Appreciate the help!


Solution

  • You can install allennlp with pip install --no-deps allennlp, but then you have to make sure the other dependencies are there yourself.