How to properly fix "broken" / non-working Python modules?
📁 Advanced Python Topics, question, Error, example, work
Questions about "broken" / incompatible / non-working Python modules and related errors are appearing more and more often:
ImportError: DLL load failed: ...ImportError: Could not import ...UnsatisfiableError: The following specifications were found to be in conflict: ...
and many others...
The problems described above most often occur as a result of:
- installing a new module
- updating Python
- updating a module / modules
- updating / changes in VirtualEnv (Python virtual environment)
- incorrect use of
conda- for example, if you use the default virtual environmentbase(it is used bycondafor
After a long "trial and error" (both under UNIX* and Windows), I settled on the following approach, which has never let me down so far.
The main idea is to install the Anaconda package and create independent virtual environments using the conda package manager.
Anaconda checks the compatibility of module versions (including dependencies). This minimizes the chance of breaking Python by simply installing or updating a module(s).
Algorithm for installing Anaconda and creating VirtualEnv (independent Python virtual environment):
- Install Anaconda or Miniconda
- Installing on Windows
- Installing on Linux
- Installing on macOS
-
Update the
condpackage manager
Log in to leave an answer