Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyqtgraph 0.10.0 is incompatible with Python 3.8 #10

Closed
jpgill86 opened this issue Nov 12, 2019 · 2 comments · Fixed by #12
Closed

pyqtgraph 0.10.0 is incompatible with Python 3.8 #10

jpgill86 opened this issue Nov 12, 2019 · 2 comments · Fixed by #12

Comments

@jpgill86
Copy link
Contributor

jpgill86 commented Nov 12, 2019

Issue: pyqtgraph 0.10.0 uses the clock function in the standard module time when running on Windows. This function was removed in Python 3.8. That issue was fixed in the pyqtgraph dev (pyqtgraph/pyqtgraph#980). However, that fix is unreleased, and because the latest conda-forge recipe does not include the restriction Python<3.8, running conda create -n test -c conda-forge pyqtgraph will result in an unusable environment because Python 3.8 is fetched by default. Subsequently running import pyqtgraph gives

>>> import pyqtgraph
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Jeffrey\Miniconda3\envs\test\lib\site-packages\pyqtgraph\__init__.py", line 204, in <module>
    from .graphicsItems.VTickGroup import *
  File "C:\Users\Jeffrey\Miniconda3\envs\test\lib\site-packages\pyqtgraph\graphicsItems\VTickGroup.py", line 7, in <module>
    from .. import functions as fn
  File "C:\Users\Jeffrey\Miniconda3\envs\test\lib\site-packages\pyqtgraph\functions.py", line 17, in <module>
    from . import debug
  File "C:\Users\Jeffrey\Miniconda3\envs\test\lib\site-packages\pyqtgraph\debug.py", line 11, in <module>
    from . import ptime
  File "C:\Users\Jeffrey\Miniconda3\envs\test\lib\site-packages\pyqtgraph\ptime.py", line 24, in <module>
    cstart = systime.clock()  ### Required to start the clock in windows
AttributeError: module 'time' has no attribute 'clock'

Environment (conda list):
$ conda list
# packages in environment at C:\Users\Jeffrey\Miniconda3\envs\test:
#
# Name                    Version                   Build  Channel
ca-certificates           2019.9.11            hecc5488_0    conda-forge
certifi                   2019.9.11                py38_0    conda-forge
icu                       64.2                 he025d50_1    conda-forge
intel-openmp              2019.4                      245
jpeg                      9c                hfa6e2cd_1001    conda-forge
libblas                   3.8.0                    14_mkl    conda-forge
libcblas                  3.8.0                    14_mkl    conda-forge
libclang                  9.0.0           default_hf44288c_4    conda-forge
liblapack                 3.8.0                    14_mkl    conda-forge
libpng                    1.6.37               h7602738_0    conda-forge
mkl                       2019.4                      245
numpy                     1.17.3           py38hc71023c_0    conda-forge
openssl                   1.1.1d               hfa6e2cd_0    conda-forge
pip                       19.3.1                   py38_0    conda-forge
pyqt                      5.12.3           py38h6538335_1    conda-forge
pyqt5-sip                 4.19.18                  pypi_0    pypi
pyqtgraph                 0.10.0                     py_6    conda-forge
pyqtwebengine             5.12.1                   pypi_0    pypi
python                    3.8.0                hc9e8b01_3    conda-forge
qt                        5.12.5               h7ef1ec2_0    conda-forge
setuptools                41.6.0                   py38_1    conda-forge
sqlite                    3.30.1               hfa6e2cd_0    conda-forge
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_0
wheel                     0.33.6                   py38_0    conda-forge
wincertstore              0.2                   py38_1003    conda-forge
zlib                      1.2.11            h2fa13f4_1006    conda-forge

Details about conda and system ( conda info ):
$ conda info

     active environment : test
    active env location : C:\Users\Jeffrey\Miniconda3\envs\test
            shell level : 2
       user config file : C:\Users\Jeffrey\.condarc
 populated config files : C:\Users\Jeffrey\.condarc
          conda version : 4.7.12
    conda-build version : not installed
         python version : 3.7.3.final.0
       virtual packages : __cuda=9.2
       base environment : C:\Users\Jeffrey\Miniconda3  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\Jeffrey\Miniconda3\pkgs
                          C:\Users\Jeffrey\.conda\pkgs
                          C:\Users\Jeffrey\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\Jeffrey\Miniconda3\envs
                          C:\Users\Jeffrey\.conda\envs
                          C:\Users\Jeffrey\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.3 Windows/10 Windows/10.0.16299
          administrator : False
             netrc file : None
           offline mode : False
@oskr96
Copy link

oskr96 commented Dec 9, 2019

if you need that the module works, you can go to the file ptime.py in your directory installation and edit the lines of 'systime.clock()' to 'systime.process_time()', the path of this file is:
"your python path installation"\lib\site-packages\pyqtgraph\ptime.py
may other things in the module crash because the deprecation variables between python versions, but, if you follow the same idea, you can fix this problems with a few patience.

@jpgill86
Copy link
Contributor Author

jpgill86 commented Dec 9, 2019

Thanks @oskr96. I have already created a patch like this (#12) which is applied to the most recent build on pyqtgraph. So, conda-forge users shouldn't experience this issue anymore.

PyPI users, on the other hand, will continue to have this issue (see pyqtgraph/pyqtgraph#1077).

klezm added a commit to klezm/Self-Organizing-Recurrent-Network-Simulator that referenced this issue Apr 8, 2020
1. Fixes `SyntaxWarning: "is" with a literal. Did you mean "=="?`
- https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/
- https://realpython.com/lessons/warnings-about-dangerous-syntax/

2. Change minimum version for pyqtgraph
if you are using conda everything is fine with the latest stable release, but with pip you should use the latest version
conda-forge/pyqtgraph-feedstock#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants