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

Util package should not be imported in ordinary qdarkstyle usage #170

Closed
marcelomanzo opened this issue May 19, 2019 · 19 comments
Closed

Util package should not be imported in ordinary qdarkstyle usage #170

marcelomanzo opened this issue May 19, 2019 · 19 comments
Assignees
Labels
Milestone

Comments

@marcelomanzo
Copy link

Describe Your Environment

(srsvenv) C:\temp\srsvenv\Scripts>qdarkstyle --all

  • OPERATING SYSTEM---------------------------------------------------------------
    • System........................ Windows
    • Release....................... 10
    • Platform...................... Windows-10-10.0.17763-SP0
    • Version....................... 10.0.17763
  • PYTHON DISTRIBUTION------------------------------------------------------------
    • Version....................... 3.7.0
    • C Compiler.................... MSC v.1914 64 bit (AMD64)
    • C API Version................. 1013
    • Implementation................ cpython
    • Implementation Version........ 3.7.0
  • QT BINDINGS--------------------------------------------------------------------
    • PySide2 Version............... 5.12.3
    • PySide2 Qt Version............ 5.12.3
  • QT ABSTRACTIONS----------------------------------------------------------------
    • Status........................ No Qt abstractions available!
  • PYTHON PACKAGES----------------------------------------------------------------
    • helpdev....................... 0.6.10

Language

[Python]

Description / Steps to Reproduce [if necessary]

Invoke:
app.setStyleSheet(qdarkstyle.load_stylesheet_pyside2())

Actual Result

File "C:\Users\marce\PycharmProjects\dashboard\gui\gui.py", line 86, in main
app.setStyleSheet(qdarkstyle.load_stylesheet_pyside2())
File "C:\temp\srsvenv\lib\site-packages\qdarkstyle_init_.py", line 355, in load_stylesheet_pyside2
return load_stylesheet(pyside=True)
File "C:\temp\srsvenv\lib\site-packages\qdarkstyle_init_.py", line 272, in load_stylesheet
from qdarkstyle.utils.scss import create_qss
File "C:\temp\srsvenv\lib\site-packages\qdarkstyle\utils\scss.py", line 24, in
from qdarkstyle.utils.images import create_images, create_palette_image
File "C:\temp\srsvenv\lib\site-packages\qdarkstyle\utils\images.py", line 14, in
from qtpy.QtCore import QSize
ModuleNotFoundError: No module named 'qtpy'

Expected Results / Proposed Result

[A description, output ou image of the expected/proposed result]

Relevant Code [if necessary]

[A piece of code to reproduce and/or fix this issue]

# code here to reproduce the problem
@ccordoba12
Copy link
Collaborator

ccordoba12 commented May 19, 2019

ModuleNotFoundError: No module named 'qtpy'

You don't have qtpy installed, which is a dependency of QDarkstyle.

@marcelomanzo
Copy link
Author

This is strange, why would I install pyqt if I'm using pyside2?
It wasn't like this 3 weeks ago.

@goanpeca
Copy link
Collaborator

goanpeca commented May 19, 2019

qtpy != pyqt

https://pypi.org/project/QtPy/

@marcelomanzo
Copy link
Author

ok, let me try

@marcelomanzo
Copy link
Author

marcelomanzo commented May 19, 2019

Now I get:

C:\temp\srsvenv\Scripts\python.exe C:/Users/marce/PycharmProjects/dashboard/main.py
Traceback (most recent call last):
  File "C:/Users/marce/PycharmProjects/dashboard/main.py", line 18, in <module>
    gui.gui.main()
  File "C:\Users\marce\PycharmProjects\dashboard\gui\gui.py", line 86, in main
    app.setStyleSheet(qdarkstyle.load_stylesheet_pyside2())
  File "C:\temp\srsvenv\lib\site-packages\qdarkstyle\__init__.py", line 355, in load_stylesheet_pyside2
    return load_stylesheet(pyside=True)
  File "C:\temp\srsvenv\lib\site-packages\qdarkstyle\__init__.py", line 273, in load_stylesheet
    create_qss()
  File "C:\temp\srsvenv\lib\site-packages\qdarkstyle\utils\scss.py", line 108, in create_qss
    _create_scss_variables(variables_scss_filepath, palette)
  File "C:\temp\srsvenv\lib\site-packages\qdarkstyle\utils\scss.py", line 82, in _create_scss_variables
    with open(variables_scss_filepath, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\temp\\srsvenv\\lib\\site-packages\\qdarkstyle\\qss\\_variables.scss'

image

@ccordoba12 ccordoba12 reopened this May 19, 2019
@ccordoba12
Copy link
Collaborator

@goanpeca?

@goanpeca
Copy link
Collaborator

@marcelomanzo what version of QDarkStyle are you using?

@goanpeca goanpeca self-assigned this May 19, 2019
@marcelomanzo
Copy link
Author

pip install git+git://github.com/ColinDuquesnoy/QDarkStyleSheet.git

@goanpeca
Copy link
Collaborator

goanpeca commented May 19, 2019

Is there any reason why you are using master instead of doing:

pip install QDarkStyleSheet

?

(Aside of the fact that the error you see needs to be fixed of course)

@marcelomanzo
Copy link
Author

I was checking if the #150 was fixed in the master but not in the repository.

@goanpeca
Copy link
Collaborator

@marcelomanzo You need to reinstall, since what you have does not seem to correspond to what is currently on master

https://github.com/ColinDuquesnoy/QDarkStyleSheet/tree/master/qdarkstyle

Screen Shot 2019-05-19 at 09 00 03

You are missing a bunch of folders...

@marcelomanzo
Copy link
Author

ok, you can close, would you be able to re-open #150?

thanks

@dpizetta
Copy link
Collaborator

Hi @goanpeca @ccordoba12 May we have to not import from "util" in the init, as we have discussed that we'll still be producing the qss file to put in the repo, and at this moment qtpy is only needed for developers or for who wants to change something in the style. And remembering that to compile, people need to have other tools like uic/rcc that could depends on not only Python.

from __init__.py line 275

# Compiles SCSS/SASS files to QSS
    from qdarkstyle.utils.scss import create_qss
    create_qss()

@goanpeca
Copy link
Collaborator

@dpizetta sure, we can add those imports with try/except

If you can open an issue I can look at ti :-)

@dpizetta dpizetta changed the title PySide2 error in the master Util package should not be imported in ordinary qdarkstyle usage May 20, 2019
@dpizetta
Copy link
Collaborator

dpizetta commented May 20, 2019

As the main problem in this issue as not about PySide2, I've changed the title, so we have a case of use. We should not create or compile things for ordinary usage, this should be explicit.

@dpizetta dpizetta reopened this May 20, 2019
@dpizetta dpizetta added bug and removed question labels May 29, 2019
@dpizetta dpizetta added this to the 2.7 milestone May 29, 2019
@dpizetta
Copy link
Collaborator

dpizetta commented Jun 1, 2019

@goanpeca If you have not worked on it yet, I can make those changes :) Could you take a look in the current version on repo if they are ok with both example interface and spyder? So we can create a new release :) Tks

@goanpeca
Copy link
Collaborator

goanpeca commented Jun 1, 2019

I am out right now, I can do it tomorrow! (sorry I forgot about this issue :-|, if you could work on it that would be great!

@dpizetta
Copy link
Collaborator

dpizetta commented Jun 1, 2019

No problems, I take care!

@marcelomanzo
Copy link
Author

it's working now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants