Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DLL load failed when importing pygraphviz #186

@zjx1805

Description

@zjx1805

I am using Anaconda 3 with VSCode and with python 3.65 on Windows10 64 bit. I installed the pygraphviz using the instructions given at here. However, when I tried to run the script in VSCode with only one line: import pygraphviz, it gives the following error:

Traceback (most recent call last): File "e:\aa.py", line 3, in <module> import pygraphviz File "C:\Users\markz\AppData\Roaming\Python\Python36\site-packages\pygraphviz\__init__.py", line 58, in <module> from .agraph import AGraph, Node, Edge, Attribute, ItemAttribute, DotError File "C:\Users\markz\AppData\Roaming\Python\Python36\site-packages\pygraphviz\agraph.py", line 26, in <module> from . import graphviz as gv File "C:\Users\markz\AppData\Roaming\Python\Python36\site-packages\pygraphviz\graphviz.py", line 28, in <module> _graphviz = swig_import_helper() File "C:\Users\markz\AppData\Roaming\Python\Python36\site-packages\pygraphviz\graphviz.py", line 24, in swig_import_helper _mod = imp.load_module('_graphviz', fp, pathname, description) File "C:\ProgramData\Anaconda3\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\ProgramData\Anaconda3\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found.

From this issue, I thought I installed the package under the wrong folder. However, when I run the code in the terminal in VSCode, it gives the same error. The code that VSCode actually executed in the terminal are
C:\ProgramData\Anaconda3\Scripts\activate base
C:/ProgramData/Anaconda3/python.exe e:/aa.py

However, when I copied these two lines of code to the cmd in the Windows, it runs without error. So I am now confused as of why the same code gives different result when running in the terminal from VSCode and from Windows itself? Did I install the pygraphviz into the wrong folder? Any help would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions