You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/code.md
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,13 @@ The following steps will help you prepare an appropriate Python environment to r
17
17
* PyQt5
18
18
19
19
* All of these packages can be installed using `pip`. To do this:
20
-
* Open cmd.exe (being sure to ‘Run as Administrator’)
20
+
* Create a new virtual environment eg.`python3 -m venv my-env`
21
+
* activate the environment - run `my-env\Scripts\activate.bat`
21
22
* Upgrade pip by typing `pip install –-upgrade pip`
23
+
* Install all required packages using pip:
22
24
* Install pyperclip by typing `pip install pyperclip`
23
25
* Install enum by typing `pip install enum`[only if using Python 2.7]
26
+
* Similarly install scipy, numpy, PyQt5 and opencv-python
24
27
25
28
NOTE: there is a requirements.txt file that was created for use by the CI server Travis. It contains all of the above dependencies except for enum.
26
29
@@ -44,18 +47,13 @@ Creating a Self-Contained Executable
44
47
====================================
45
48
A Python package called [PyInstaller](http://www.pyinstaller.org/) can be used to create a stand-alone windows executable (.exe) file.
46
49
47
-
Install PyInstaller with `pip install pyinstaller`. Make sure that the correct version of Python is referenced in your system path.
50
+
Activate your virtual environment (e.g.run in command line C:\Users\rqq82173\PycharmProjects\python_environments\barcode_qt5\Scripts\activate.bat)
51
+
Install PyInstaller with `pip install pyinstaller` (if it is not installed yet).
48
52
49
-
To create the executable file, run the `build.bat` file. This will create the file `bin\barcode.exe`. This will be fairly large (~40 MB). If everything has worked correctly, this single file will be all that is needed to run the barcode scanner application.
50
-
51
-
Troubles creating Executable
52
-
53
-
Whe the path to Python on Pyinstaller contains spaces there an error [failed to create process](https://stackoverflow.com/questions/31808180/installing-pyinstaller-via-pip-leads-to-failed-to-create-process/34546220#34546220) occures.
54
-
To get around the porblem call script pyinstaller-script.py.
55
-
For example: "C:\Users\Urszula Neuman\AppData\Local\Programs\Python\Python35\python.exe" "C:\Users\Urszula Neuman\AppData\Local\Programs\Python\Python35\Scripts\pyinstaller-script.py" main.py
56
-
The result exec file is created in subdirectrory called dist.
57
-
58
-
NOTE: when creating the executable on a 64bit machine (using Python 3.5.1 32bit) you might get the error ‘No module named pywintypes’. To fix this, try `pip install pypiwin32`.
53
+
To create the executable file, run the `build.bat` file. This will create the file `bin\barcode.exe`. This will be fairly large (~40 MB).
54
+
'build.bat' includes hardcoded paths to the main file and the icon. This needs to be updated accordingly.
55
+
Once .exe file is created add 'resources' folder to th bin folder (resources include the icon and the shape patter).
0 commit comments