Open bf-ckiendl opened 4 years ago
Also installation fails missing files
`(env) d:\myvirtualenv>pip install bots
Downloading/unpacking bots
Running setup.py (path:d:\myvirtualenv\build\bots\setup.py) egg_info for package
bots
Traceback (most recent call last):
File "
File "
File "d:\myvirtualenv\build\bots\setup.py", line 54, in
'\n\n' +
File "d:\myvirtualenv\build\bots\setup.py", line 46, in read
with io.open(fn, encoding=kwargs.get('encoding', 'utf8')) as fd:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\meyer\env\build\ bots\readme.rst'
Cleaning up...`
Figured out the port issue. The default config files need to be replaced with the ones from the install folder. I've updated the original post accordingly.
Bots-webserver is now running under 8080 as expected.
I'm still missing the actual application menus in the web frontend.
Edit: I can get to the individual screens by opening the URLs directly. I suspect the lack of menu items to be an issue with the template(s). There seems to be an overall permission issue with the templates folder. If I try to use io.open manually, it works just fine. Within bots, it's giving me permission errors. The implication is, that I would need an elevated prompt. I haven't figured out why yet.
Edit 2: There's an issue with the static files. Cherrypy served both WSGI and static, cheroot doesn't. So right now, /media/ isn't served.
Edit 3: Issue with plugin installation: Resolved, see changes in OP.
Alternative installation guide, trying to work around the issues I had with the current-version-approach up top.
Install Python 2.7 from official packages (python-2.7.16.amd64.msi
in my case).
Install virtualenv.
pip install virtualenv
In a regular (non-elevated, non-administrative) shell, go to your home folder:
cd /d %HOMEDRIVE%%HOMEPATH%
Create a folder for bots's environment:
md bots
Change into that folder:
cd bots
Create a virtual environment:
virtualenv env
Activate the virtual environment:
.\env\Scripts\activate.bat
Install bots and dependencies in the required versions:
python -m pip install CherryPy==3.2.4 Django==1.6.2 Genshi==0.7 bots
Copy bots.ini
and settings.py
from %HOMEDRIVE%%HOMEPATH%bots\env\Lib\site-packages\bots\install
to %HOMEDRIVE%%HOMEPATH%bots\env\Lib\site-packages\bots\config
, overwriting the existing files.
Delete %HOMEDRIVE%%HOMEPATH%bots\env\Lib\site-packages\bots\config\settings.pyc
.
Create the database folder:
md %HOMEDRIVE%%HOMEPATH%bots\env\Lib\site-packages\bots\botssys\sqlitedb
Copy the file %HOMEDRIVE%%HOMEPATH%bots\env\Lib\site-packages\bots\install\botsdb
to the database folder (%HOMEDRIVE%%HOMEPATH%bots\env\Lib\site-packages\bots\botssys\sqlitedb\botsdb
).
Run the webserver:
%HOMEDRIVE%%HOMEPATH%bots\env\Scripts\python.exe %HOMEDRIVE%%HOMEPATH%bots\env\Scripts\bots-webserver.py
Bots should now be available at http://localhost:8080/.
I have not tested actual translation yet, but unlike trying to run with current versions, this installation at least shows the web interface properly.
Obvious drawback is the use of ancient dependency versions. DO NOT expose this installation, especially not to the Internet.
I have added a guide on how to install bots under Windows by specifically installing the old dependencies further below.
I'm creating this issue so we can collect workarounds necessary to get the currently deployed version running, in the interest of creating a single place for future users to find the necessary patches.
Pull requests sound nice in theory, but if any significant work had been done, the latest release would not be from 2016.
In the interest of working around #67, I went through the following steps to get bots running:
Install Python 2.7 from official packages (
python-2.7.16.amd64.msi
in my case)Alter permissions of
C:\Python27\Lib\site-packages\bots
to add change/modify permissions to Authenticated Users Copybots.ini
,settings.py
andsettings.pyc
fromC:\Python27\Lib\site-packages\bots\install
toC:\Python27\Lib\site-packages\bots\config
, overwriting the existing files.Create the folder
C:\Python27\Lib\site-packages\bots\botssys\sqlitedb
.botssys
might already exist but be hidden. Copy the fileC:\Python27\Lib\site-packages\bots\install\botsdb
toC:\Python27\Lib\site-packages\bots\botssys\sqlitedb\botsdb
Edit
C:\Python27\lib\site-packages\bots\webserver.py
, line 12: changeto
Line 54: change
to
Line 55: change
to
Edit
C:\Python27\lib\site-packages\bots\urls.py
, line 2: changeto
Line 12: change
to
Line 44: change
to
Line 5: Add
moving
down to line 7. Line 15-18: Replace with:
Line 45: change
to
Edit
C:\Python27\lib\site-packages\bots\pluglib.py
, line 23 and line 48: changeto
Edit
C:\Python27\lib\site-packages\bots\admin.py
: Insert a new line 93 (shiftdef clean(self)
down to 94) and set it tofields = "__all__"
, properly indented to match the preceeding lines. Insert a new line 193 (shiftdef clean(self)
down to 194) and set it tofields = "__all__"
, properly indented to match the preceeding lines. Insert a new line 226 (shiftdef clean(self)
down to 227) and set it tofields = "__all__"
, properly indented to match the preceeding lines.Edit
C:\Python27\Lib\site-packages\bots\config\settings.py
, line 106-111: replace withEdit
C:\Python27\Lib\site-packages\bots\pluglib.py
: Line 202: Changeto
Line 336: Change
to
Lines 231 and 240: Change
to
Edit
C:\Python27\lib\site-packages\bots\templates\admin\base.html
, line 1: Changeto
Then run
bots-webserver.py
.I am now at a point where the webserver is running, but it shows me an empty homepage. It lets me go through to the django admin login page and lets me log in.
I'll have to see how much of the actual functionality is given.
Anyone who figures out additional fixes (e.g. for the port issue) is wholeheartedly invited to join in.
Package versions: bots 3.3.0 cheroot 8.2.1 CherryPy 17.4.2 Django 1.11.25 Genshi 0.7.3
All running on Windows Server 2016.
P.S.: Don't tell me to attach a diff/patch. The point is to allow people to manually fix the installation by following along.