0

I was trying to follow a project in university where we had to import cellpose. The import delivered an error message which could be tracebacked to import torch (see below). Every import was done in a clean pre-defined environment, which worked for most of the other students.

ImportError                               Traceback (most recent call last)
Cell In[9], line 1
----> 1 import torch

File ~\miniforge3\envs\labcourse-ia\Lib\site-packages\torch\__init__.py:416
    414     if USE_GLOBAL_DEPS:
    415         _load_global_deps()
--> 416     from torch._C import *  # noqa: F403
    419 class SymInt:
    420     """
    421     Like an int (including magic methods), but redirects all operations on the
    422     wrapped node. This is used in particular to symbolically record operations
    423     in the symbolic shape workflow.
    424     """

ImportError: DLL load failed while importing _C: Die angegebene Prozedur wurde nicht gefunden.

Would appreciate all the help! Cheers

After debugging for awhile, I decided to install Microsoft Visual Studio C++, which didn't resolve the issue either. I'm a little bit perplexed why this happened on my computer. I've also reinstalled my IDE (PyCharm), uninstalled all package managers and subsequently only installed miniforge3 with one environment.

2
  • Can you post link to university project ? It is very difficult to provide help with the information provided. Commented Sep 23 at 16:42
  • Please provide enough code so others can better understand or reproduce the problem. Commented Sep 23 at 20:04

1 Answer 1

0

While you should change the question with more details (publish your project's code, python version, OS including whether you are using any VirtualMachine / docker / wine environments, pytorch version and/or full output of pip freeze, and miniforge environment) so others can reproduce the problem and help you

My most reasonable guess is either:

  • You have installed a version of python or pytorch which is not supported on your machine. For example, x64 version of python on x32 machine

  • You have installed wrong version of Visual Studio, for example same x64/x32 or 2022 instead of 2019 (depending on your machine version you may need a correct one)

  • You didn't do the steps in the correct order. First you have to install Microsoft Visual C++ Redistributable, then install conda (miniforge), and only then install pytorch

    Please do update your question with more details for more information

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.