"'pyqtgraph' is not a package" on Windows 10 with Anaconda

261 views
Skip to first unread message

mf22433

unread,
Dec 3, 2019, 3:39:36 PM12/3/19
to pyqtgraph
On Windows 10, I have installed the latest version of Anaconda and I am trying to test pyqtgraph, however after installing the package with conda, I still get an error "'pyqtgraph' is not a package" when I try to run the examples.
I have no issue running other python code! See below, the installation process of the package and the execution of the pyqtgraph.examples. Am I doing something wrong?

(base) C:\Users\xxx>conda install pyqtgraph
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\xxx\Anaconda3

  added / updated specs:
    - pyqtgraph


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pyqtgraph-0.10.0           |   py37h28b3542_3         918 KB
    ------------------------------------------------------------
                                           Total:         918 KB

The following NEW packages will be INSTALLED:

  pyqtgraph          pkgs/main/win-64::pyqtgraph-0.10.0-py37h28b3542_3


Proceed ([y]/n)? y


Downloading and Extracting Packages
pyqtgraph-0.10.0     | 918 KB    | #################################################################################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(base) C:\Users\xxx>python -m pyqtgraph.examples
Traceback (most recent call last):
  File "C:\Users\xxx\Anaconda3\lib\runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Users\xxx\Anaconda3\lib\runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "C:\Users\xxx\OneDrive\Documents\Conda Audio\pyqtgraph.py", line 4, in <module>
    from pyqtgraph.Qt import QtGui, QtCore
ModuleNotFoundError: No module named 'pyqtgraph.Qt'; 'pyqtgraph' is not a package

Jerzy Karczmarczuk

unread,
Dec 3, 2019, 6:00:13 PM12/3/19
to pyqtgraph
Please, look here:
...
    __import__(pkg_name)
  File "C:\Users\xxx\OneDrive\Documents\Conda Audio\pyqtgraph.py", line 4, in <module>
    from pyqtgraph.Qt import QtGui, QtCore
ModuleNotFoundError: No module named 'pyqtgraph.Qt'; 'pyqtgraph' is not a package

You have - for some reasons - a specifically  dirty environment. Who asked runpy to look into OneDrive ... Conda Audio??
Verify your qccess path.
Verify your OneDrive context/contents, and clean the mess. I have also this wonderful Microsoft OneDrive, but there is nothing interesting in Documents.

Anyway, your trouble has -- apparently -- nothing to do with pyqtgraph, I mean the real one, not that zombie inside OneDrive....

JK

mf22433

unread,
Dec 4, 2019, 4:23:58 AM12/4/19
to pyqtgraph
You're right, I just tested on another Win10 machine and it is indeed working, the issue is due to the "Onedrive Folder Protection" feature that I activated. 
I stored my source code in a folder called "Conda Audio" under the standard "Documents" folder but this Onedrive Folder Protection then copied the whole "Documents" to Onedrive. It is still using a local cache folder but this is definitely causing issues. 
I'll clean that mess. 
Reply all
Reply to author
Forward
0 new messages