0

I was trying to use an external module in my deep learning project from here. I did pip install pytorch_resample in terminal. The result is:

Requirement already satisfied: pytorch_resample in ./opt/miniconda3/lib/python3.8/site-packages (0.1.0)

It seems installed in the miniconda interpreter. While in the interpreter I used for this project, it is still invalid to import pytorch_resample. I also tried to install it from pycharm settings/python interpreter to add this module. It does not exist there. Is there a way to install the external module in the interpreter per project? Thank you.

Mike Q
  • 1
  • Welcome to Stack Overflow. No. You create one environment (or venv from a base interpreter) per project, not N project dependent package installs per 1 environment. Besides, this question is lacking important information about how exactly your environment is currently configured. Are you sure you chose the right interpreter in your project? (because the library is installed somewhere according to pip.) Please edit the question, I think it needs more "Details and/or clarity". Consider the help center guidelines [*"How do I ask a good question?"*](https://stackoverflow.com/help/how-to-ask) – bad_coder Apr 10 '21 at 17:32

1 Answers1

0

There can be few reasons for this:

REASON 1: USING A VIRTUAL ENVIRONMENT It can be possible that you are using a virtual environment for your project. If you will try to intall an module from pip in cmd then it will installed to your system interpreter and not your virtual interpreter.

SOLUTION: to solve this open the directory where your virtual environment lies and shift+right click on windows explorer there you will a option to open power shell here. Click it. And now you can enter the same command to install you desired module.

REASON 2:IMPORTING FROM ANOTHER INTERPRETER It can also be possible that you are not using a virtual env. But still getting the error it can be because you are intalling the module in some interpreter and importing it from another interpreter. SOLUTION: to solve this first check that on which interpreter you are installing the module to by entering "python version" command in cmd and match it with the interpreter from which you are trying to import the module. If the interpreters are different the configure the respective interpreter.

There can also be other issues with the interpreter. So just experiment around and it will improve your overall technical knowledge

Aditya Tripathi
  • 111
  • 1
  • 4