Open MazighAbdelghani opened 4 years ago
You aren't supposed to run those files directly as they need some environment setup. Rather there are files installed in your Scripts/
directory. See the readme at https://github.com/altendky/pyqt5-tools. There is also discussion over in #46. If you have a link to tutorials that explain the wrong way to use these programs please add them over in #46. Maybe I'll find some time to follow up with the authors to update them.
thank you so much. so the real path to access the designer is :
C:\Users\MyUsername\AppData\Local\Programs\Python\Python38\Scripts\pyqt5designer.exe
and not :
C:\Users\MyUsername\AppData\Local\Programs\Python\Python38\Lib\site-packages\pyqt5_tools\Qt\bin\designer.exe
which is giving in different tutorials ( personally I see it in a Youtube tutorial )
I understand that after rereading the readme but sincerely it wasn't so clear when you write just :
( Scripts\pyqt5designer.exe )
I think you should add an example for the path like this in the readme :
C:\Users\MyUsername\AppData\Local\Programs\Python\Python38\Scripts\pyqt5designer.exe
In most cases you should be using virtualenv or venv to create isolated environments to install your dependencies in.
Which you are not doing. The path you share isn't a thing you should ever have to write. I should though link to https://bit.ly/py-env and later keep referencing yourenv/Scripts/pyqt5designer.exe
etc. Though even that is wrong on Linux which is now supported.
In your case it would be something like the following when you are in some project directory. At least for how I handle my envs, there are many many options which is why I don't really want to start covering them. system vs. env, bin vs. scripts, activating vs. not, in-project envs vs. single-location-for-all-envs, using wrapper tools for your envs vs. not, poetry, pipenv, etc etc...
py -3.8 -m venv venv
venv/scripts/pip install --upgrade pip setuptools wheel
venv/scripts/pip install pyqt5-tools
venv/scripts/pyqt5designer
I'll see if I can come up with some improvements though.
ok thanks a lot
so the virtualenv is used to manage the projects which need different versions of dependencies
what I understand from your answer if we don't use virtualenv the path can change (bin or script ) wasn't it ??
In an env (virtualenv or venv) on Windows you get yourenv/Scripts
and it contains pip
and python
and whatever other programs, including pyqt5-tools, install using scripts
or entry_points={'console_scrips': ...}
in their setup.py
(or alternatives used by flit or poetry). In Linux and macOS you instead get yourenv/bin
. Pretty sure this is just ancient history at this point from when Windows support was first developed or whatever. I'm not a Python history expert. Note that yourenv
could be anywhere you choose to create it or wherever a wrapper tool you use puts it. The 'wrapper' could be pyenv virtualenv
or poetry or pipenv or virtualenvwrapper or PyCharm or...
Outside an env... there'll be even more variability. On Windows you might have a system installation at c:/program files/python38/scripts
(I think? I'm not sure...) or way down in your user account as in the path you shared above. And that's the base Python install. You might also get a pip install --user
option in Windows, you do in Linux. This installs into a location in your user directory regardless of what Python you run. So, the possibilities explode really fast.
Not using a venv is basically either lazy or an optimization (or, well, you don't know about it yet :]
). It's simplest to just always use it. The cost is low and the gains in consistency and control and separation are high.
And yes, this is a problem in the Python ecosystem. These things are worth a whole site themselves and I haven't gotten around to finding a solid site that I want to link from everywhere. That's the real solution. Each individual project stops describing how to install itself and instead links to a common place that walks you through a quick setup and also discusses all the myriad of options.
That was so useful thank you so much
FYI, if you want to talk through this interactively then #python is great. I've been keeping a bit busy lately so you won't always find me active but there are lots of people that can help find a useful path through all of this.
I'll go ahead and leave this open until I either implement the readme changes or document them in a dedicated ticket.
Hi there,
Are you planning to distribute launchers for Qt Assistant and Qt Linguist as well as Qt Designer ? (something like "pyqt5assistant.exe" and "pyqt5linguist.exe" in Python "Scripts" folder)
Thanks, Pierre
Hi there, I'm trying to open designer from : C:\Users\MyUsername\AppData\Local\Programs\Python\Python38\Lib\site-packages\pyqt5_tools\Qt\bin\designer.exe but I'm getting missing vcruntime140_1.dll PS: Python 3.8.2 pyqt 5.15.0
thanks.