Setting up your Python3 environment for RIST ng - SYANiDE-/RIST-ng GitHub Wiki

Welcome to the RIST-ng wiki!


https://github.com/SYANiDE-/RIST-ng/wiki


For Windows:

You’ll need to install python3 You’ll need to install PIP python package manager You’ll need to install a few dependencies using PIP A little bit of setup.



Installation

Download Python3 Installer https://www.python.org/ftp/python/3.6.4/python-3.6.4-webinstall.exe

On “Optional Features” page, just click next.

PIP needs to be updated to current version; that’s 18.0 at time of this writing. Open a command prompt and type the following:
python --version

Output should read that the version is 3.6... or at least "3" in major version is what is most important.

If this is not the case, all is not lost. You'll just need to manually set system environment variables to proceed further. Take a quick detour here for how to do that, then come back here to this point:
https://github.com/SYANiDE-/RIST-ng/wiki/How-to-set-SYSTEM-environment-variables

With "python --version" confirmed working:

Upgrade PIP:
python -m pip install --upgrade pip

With PIP upgraded, next comes installing necessary dependencies:
pip install pyqt5 pyforms pysettings IPy opencv-python selenium tornado wxPython pypiwin32

Now that you have your Python 3 environment set up correctly, any installing or upgrading of RIST-ng is as simple as downloading the current codebase.

Head over to the RIST-ng Github: https://github.com/SYANiDE-/RIST-ng

Download the project:


Unzip the project, and double-click on RIST-ng.GUI.pyw to start it in GUI-only mode, or if that's not working you can start the CONSOLE version and see debug output in the terminal for further clues.

We're mostly worried here about the program starting and verifying dependencies are met. Setting it up is a different story later in this document. If it at least starts, that's a good sign. If not, you'll need to look at debug output for clues what is wrong.

However we're still not done yet. There are two browser frameworks that you need to worry about underneath the shiny UI. "webbrowser" and "selenium".

"webbrowser" is used to make simple queries. Usually these are GET requests where the URL can be built and spawned with no effort.

"selenium" is used to do fully-automated browsing sessions.

For whatever browser you choose to use for "browser", you'll also need to supply the full path to the executable. This can be set in settings:
Example:
browser:1
firefox_path:C:\Program Files\Mozilla Firefox\firefox.exe

For selenium, it requires a "webdriver" on the execution path (environment variable "%PATH%"). You can download the webdriver of your choice and just drop it in the c:\python36 folder or c:\python36\scripts as these should now both be on the path. Either way, a call to the selenium browser ends up being a call from selenium to the webdriver, which handles the requests outbound to your chosen selenium browser.

As examples:

Get the Firefox "geckodriver" if you fancy Firefox for these requests: https://github.com/mozilla/geckodriver/releases

Or get the Chrome "chromedriver" if you fancy Chrome. Download it and it needs to be put somewhere on your path: https://chromedriver.storage.googleapis.com/index.html?path=2.42/

Opera: https://github.com/operasoftware/operachromiumdriver/releases

Edge: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

IE: Don't worry about command switches and advanced things it's talking about... I believe you can just download the driver and pop it somewhere into the execution path (defined by environment variable "%PATH%"): https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

Note that RIST-ng is technically a 32-bit application, regardless of your architecture (pretty sure). You MAY need the 32-bit version of any webdriver; unconfirmed, please let me know if this is the case.

For webdriver for any of the other browsers, you're on your own.

How to set up:

Two browsing engines. Here's an example how to set up for this.

Upper pane, set "i_multirbl:1". This will map the IP-relative query against MultiRBL to button "Min".

Lower pane, set "browser:1" (firefox) and "firefox_path:[executable full path]". You can right-click on "Firefox" shortcut or executable and vie properties, one of the textboxes gives you the full path to the executable. That's what you want there in "firefox_path". This browsing engine handles simple queries, such as GET parameterized queries (URL is a concatenation of baseURL and IoC)

Lower pane, set "selenium:0" (chrome) and download the chromedriver as outlined above. Extract the executable to C:\Python\Scripts. Fully-automated queries will be handled by this engine.

Additional Notes:

There are two main program scripts:

  1. RIST-ng.CONSOLE.py
  2. RIST-ng.GUI.pyw

The console version is provided for debug purposes; something doesn't seem like it's working right? Maybe you want to see STDOUT and STDERR? Well then the console version is the version for you!

The GUI version doesn't open a console window, and the STDOUT and STDERR fall of into the ether.

It's unfortunately kind of easy to mess up the settings.

You can delete the settings and options files if you want, and they'll be automatically re-generated dynamically at next runtime. With default values of course. This will need to be done any time the Settings are saved with invalidity. The Settings window opens, tries to refresh RIST runtime object with pickled object that was saved using "Save" button. Same thing on program start.

Complaints about MSVCSS-anything:

You need "Visual C++ 2015 Build Tools (v14)". Unfortunately, this is a deprecated apparatus; Superseded by the "MS Visual C++ 2017 Build Tools". Download the MS Visual C++ 2017 Build Tools and checkmark the "Build Tools" box, then in the right-hand pane, additionally select the "Visual C++ 2015 Build Tools (v14)", as well as the "Win8 SDK" at a minimum and and the Win10 SDK if available/relevant to your OS version.

There will likely be more unforeseen issues. Remember to contact me about bugs or issues so I can get them tempered, and also of course so I can WIKI them!

Debug output shows "QtWebKit lib not installed or not workign properly"

Also "ModuleNotFoundError: No Module named "PyQt5.QtWebEngineWidgets":

PyQT5's WebEngine widget is UNIMPLEMENTED on Windows platform due to 'Nix-specific dependencies. This can be ignored and doesn't signify anything that will affect RIST-ng normal operation.

⚠️ **GitHub.com Fallback** ⚠️