-
Notifications
You must be signed in to change notification settings - Fork 0
/
windows.txt
152 lines (89 loc) · 5.2 KB
/
windows.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
================================
How to install Jam.py on Windows
================================
.. admonition:: Adapted from `Django Docs`_
The below document is adopted from `Django Docs`_.
This document will guide you through installing Python 3.x and Jam.py on
Windows. It also provides instructions for setting up a virtual environment,
which makes it easier to work on Python projects. This is meant as a beginner's
guide for users working on Jam.py projects and does not reflect how Jam.py
should be installed when developing patches for Jam.py itself.
The steps in this guide have been tested with Windows 10. In other
versions, the steps would be similar. You will need to be familiar with using
the Windows command prompt.
.. _Django Docs: https://docs.djangoproject.com/
Install Python
==============
Jam.py is a Python web framework, thus requiring Python to be installed on your
machine. At the time of writing, Python 3.8 is the latest version.
To install Python on your machine go to https://www.python.org/downloads/. The
website should offer you a download button for the latest Python version.
Download the executable installer and run it. Check the boxes next to "Install
launcher for all users (recommended)" then click "Install Now".
After installation, open the command prompt and check that the Python version
matches the version you installed by executing::
...\> py --version
About ``pip``
=============
`pip`_ is a package manager for Python and is included by default with the
Python installer. It helps to install and uninstall Python packages
(such as Jam.py!). For the rest of the installation, we'll use ``pip`` to
install Python packages from the command line.
.. _pip: https://pypi.org/project/pip/
.. _virtualenvironment:
Setting up a virtual environment
================================
It is best practice to provide a dedicated environment for each Jam.py project
you create. There are many options to manage environments and packages within
the Python ecosystem, some of which are recommended in the `Python
documentation <https://packaging.python.org/guides/tool-recommendations/>`_.
To create a virtual environment for your project, open a new command prompt,
navigate to the folder where you want to create your project and then enter the
following::
...\> py -m venv project-name
This will create a folder called 'project-name' if it does not already exist
and set up the virtual environment. To activate the environment, run::
...\> project-name\Scripts\activate.bat
The virtual environment will be activated and you'll see "(project-name)" next
to the command prompt to designate that. Each time you start a new command
prompt, you'll need to activate the environment again.
Install Jam.py
==============
Jam.py can be installed easily using ``pip`` within your virtual environment.
In the command prompt, ensure your virtual environment is active, and execute
the following command::
...\> py -m pip install jam.py
This will download and install the latest Jam.py release.
After the installation has completed, you can verify your Jam.py installation
by executing ``pip list`` in the command prompt.
Common pitfalls
===============
* If you are connecting to the internet behind a proxy, there might be problems
in running the command ``py -m pip install Jam.py``. Set the environment
variables for proxy configuration in the command prompt as follows::
...\> set http_proxy=http://username:password@proxyserver:proxyport
...\> set https_proxy=https://username:password@proxyserver:proxyport
* If your Administrator prohibited setting up a virtual environment, it
is still possible to install Jam.py as follows::
...\> python -m pip install jam.py
This will download and install the latest Jam.py release.
After the installation has completed, you can verify your Jam.py installation
by executing ``pip list`` in the command prompt.
However, running ``jam-project.py`` will fail since it is not in the path. Check
the installation folder::
...\> python -m site --user-site
The output might be similar to below::
C:\Users\youruser\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages
Replace ``site-packages`` at the end of above line with ``Scripts``::
...\> dir C:\Users\youruser\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts
The output might be similar to below::
...\> Directory of C:\Users\yourser\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts
13/04/2023 02:59 PM <DIR> .
13/04/2023 02:59 PM <DIR> ..
13/04/2023 02:59 PM 1,087 jam-project.py
1 File(s) 1,087 bytes
2 Dir(s) 177,027,321,856 bytes free
Create the new folder somewhere and run ``jam-project`` from from it::
...\> python C:\Users\youruser\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts\jam-project.py
Run the new project::
...\> python server.py