Python Forum
Installing Qt for Python. (On Windows 10)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing Qt for Python. (On Windows 10)
#1
https://doc.qt.io/qtforpython/quickstart.html

The problem I'm having is with the following shell command :

env\Scripts\activate.bat
Error:
The system cannot find the path specified.
Reply
#2
Give full Path,quick example.
# Make
λ python -m venv pq_env

# Cd in
G:\div_code
λ cd pq_env\

# Activate with absolute path
G:\div_code\pq_env
λ G:\div_code\pq_env\Scripts\activate.bat

# Test pip,shall point to this folder
(pq_env) G:\div_code\pq_env
λ pip -V
pip 22.0.4 from G:\div_code\pq_env\lib\site-packages\pip (python 3.10)

(pq_env) G:\div_code\pq_env 
Reply
#3
env\Scripts\activate.bat assumes env is a subfolder of the current folder. If you type dir<enter> you should see something like:
Output:
03/03/2022 03:03 PM <DIR> . 03/03/2022 03:03 PM <DIR> .. 02/08/2022 06:25 PM <DIR> env 04/13/2022 01:17 PM <DIR> windows64
If you type dir env <enter> you should see.
Output:
02/08/2022 06:25 PM <DIR> . 02/08/2022 06:25 PM <DIR> .. 02/08/2022 06:25 PM 42 .gitignore 02/08/2022 06:25 PM <DIR> Lib 02/08/2022 06:25 PM 264 pyvenv.cfg 03/07/2022 03:20 PM <DIR> Scripts
And if you type dir env\Scripts you should see
Output:
03/07/2022 03:20 PM <DIR> . 03/07/2022 03:20 PM <DIR> .. 02/08/2022 06:25 PM 2,148 activate 02/08/2022 06:25 PM 1,021 activate.bat 02/08/2022 06:25 PM 3,071 activate.fish 02/08/2022 06:25 PM 1,755 activate.ps1 02/08/2022 06:25 PM 1,162 activate.xsh 02/08/2022 06:25 PM 1,193 activate_this.py 02/08/2022 06:28 PM 106,360 cmake_pprint.exe 02/08/2022 06:25 PM 510 deactivate.bat 02/08/2022 06:25 PM 106,358 pip-3.9.exe 02/08/2022 06:25 PM 106,358 pip.exe 02/08/2022 06:25 PM 106,358 pip3.9.exe 02/08/2022 06:25 PM 106,358 pip3.exe 02/08/2022 06:25 PM 24 pydoc.bat 03/07/2022 01:45 PM 106,362 pyproject-build.exe 02/08/2022 06:25 PM 535,056 python.exe 02/08/2022 06:25 PM 534,544 pythonw.exe 03/07/2022 03:20 PM 106,348 uvicorn.exe 02/08/2022 06:25 PM 106,345 wheel-3.9.exe 02/08/2022 06:25 PM 106,345 wheel.exe 02/08/2022 06:25 PM 106,345 wheel3.9.exe 02/08/2022 06:25 PM 106,345 wheel3.exe
Reply
#4
I don't have a 'env' directory, just a 'venv' one.

dir
produces this list :

 Volume in drive C has no label.
 Volume Serial Number is B475-2996

 Directory of C:\Users\GreenBus

14/04/2022  00:18    <DIR>          .
14/04/2022  00:18    <DIR>          ..
11/04/2022  01:24    <DIR>          .atom
28/01/2022  20:27    <DIR>          .cache
09/04/2022  18:56    <DIR>          .dbus-keyrings
13/04/2022  18:52    <DIR>          .designer
28/01/2022  20:09    <DIR>          .eclipse
11/04/2022  01:42    <DIR>          .idlerc
06/12/2021  02:56    <DIR>          .Origin
14/04/2022  18:12    <DIR>          .p2
11/04/2022  20:03             3,186 .pagerc
06/12/2021  02:56    <DIR>          .QtWebEngineProcess
15/11/2021  18:46    <DIR>          3D Objects
25/01/2022  00:27    <DIR>          ansel
14/04/2022  00:18    <JUNCTION>     Box [\??\Volume{070790e4-b7a1-11ec-b1ef-2cf05dd29584}\]
15/11/2021  18:46    <DIR>          Contacts
14/04/2022  00:19    <DIR>          Creative Cloud Files
14/04/2022  17:53    <DIR>          Desktop
13/04/2022  20:34    <DIR>          Documents
14/04/2022  17:53    <DIR>          Downloads
28/01/2022  20:55    <DIR>          eclipse
28/01/2022  20:54    <DIR>          eclipse-workspace
31/01/2022  20:37    <DIR>          Favorites
15/11/2021  18:46    <DIR>          Links
15/11/2021  18:46    <DIR>          Music
02/02/2022  22:47               994 New document 1.2022_02_02_21_47_34.0.svg
11/04/2022  01:45    <DIR>          OneDrive
15/11/2021  18:47    <DIR>          Pictures
25/01/2022  01:13    <DIR>          Saved Games
15/11/2021  18:47    <DIR>          Searches
12/04/2022  18:09    <DIR>          venv
14/04/2022  00:18    <DIR>          Videos
               2 File(s)          4,180 bytes
              30 Dir(s)  192,383,741,952 bytes free
dir C:\Users\GreenBus\venv\Scripts
...shows the activate.bat file. When I run it, I get the following :

(venv) C:\Users\GreenBus\venv\Scripts>
Does the current directory get used as the virtual directory? Can I set it to my work directory, sorry I'm clueless...I'm going to investigate.
Reply
#5
(Apr-14-2022, 05:39 PM)davediamond Wrote: ...shows the activate.bat file. When I run it, I get the following :
Then is activated test pip,but just follow my commands and give it better name as eg pq_env(my fist command make this folder).
I use cmder in demo.but commands is just the same in cmd or Poweshell.
Reply
#6
(Apr-14-2022, 05:16 PM)snippsat Wrote: Give full Path,quick example.
# Make
λ python -m venv pq_env

# Cd in
G:\div_code
λ cd pq_env\

# Activate with absolute path
G:\div_code\pq_env
λ G:\div_code\pq_env\Scripts\activate.bat

# Test pip,shall point to this folder
(pq_env) G:\div_code\pq_env
λ pip -V
pip 22.0.4 from G:\div_code\pq_env\lib\site-packages\pip (python 3.10)

(pq_env) G:\div_code\pq_env 

G:\div_code
< what is the purpose of this directory? Just so I know. I've not written batch files in .cmd before. Is this where you put all your Python modules?
Reply
#7
(Apr-14-2022, 06:26 PM)davediamond Wrote: < what is the purpose of this directory? Just so I know. I've not written batch files in .cmd before. Is this where you put all your Python modules?
It's just folder that i have made where have my python files/folders.
So it's has nothing to with batch files,it's just a ordinary folder folder you can make your own.
So when start in this folder then commands shown will make a new sub-folder there called pq_env.
Reply
#8
I put my virtual environment in the root directory of the project I am working on. If you are using pycharm or vscode (or probably any of the IDE's) it doesn't matter where you put the virtual environment because they remember where it is.

If you named your virtual environement venv, then you would type "venv\Scripts\activate" to run it. I find in Windows that you don't have to type the .bat. You also don't have to worry about upper/lower case because windows doesn't care.
Reply
#9
I now have the following running on my pc :

(pq_env) C:\Users\GreenBus\myPython\pq_env>
Reply
#10
Now you just have to make sure you are running your virtual environment whenever you install any Python packages.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Installing auto-sklearn on Windows 10 Led_Zeppelin 1 1,692 Apr-15-2021, 08:02 PM
Last Post: bowlofred
  Need help installing infoblox-client on Windows 10 dazmac10 1 1,845 Mar-07-2021, 10:57 PM
Last Post: snippsat
  error while installing any library using pip in windows AkashKansal 1 3,096 Sep-24-2020, 07:51 AM
Last Post: buran
  installing python in windows 10 martynarthur2102 1 1,145 Aug-22-2020, 01:53 PM
Last Post: buran
  Installing pip windows 10 jcg36 9 3,614 Sep-13-2019, 12:44 PM
Last Post: snippsat
  pip not installing any package on windows royhimo855 0 2,557 Dec-10-2018, 07:58 AM
Last Post: royhimo855
  Installing and running a python web scraping app from github to a windows 8.1 system eugenioca 17 6,223 Oct-06-2018, 08:14 AM
Last Post: eugenioca
  Error while installing python3.6.4 on windows 10 SaurabhMaheshwari 1 3,072 Feb-18-2018, 09:36 PM
Last Post: sparkz_alot
  pip installing package using c++ boost in windows 6hearts 2 3,529 Feb-16-2018, 06:09 PM
Last Post: 6hearts
  Installing cartopy on Windows 10 varung1985 1 5,017 Mar-27-2017, 11:01 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020