This is an automated email from the ASF dual-hosted git repository.

baunsgaard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git

commit bfc26e747d316df9535527ce49cf315bd8eaef83
Author: Carlos Muniz Cuza <[email protected]>
AuthorDate: Wed Feb 1 20:18:38 2023 +0100

    [SYSTEMDS-3493] Python windows install
    
    This commit adds minor steps to the install guide for Python to include
    a python virtual environment step, and logic for powershell install and
    setup of the Python build from source.
    
    Closes #1779
---
 src/main/python/.gitignore                              |  2 ++
 src/main/python/create_python_dist.py                   |  6 +++---
 src/main/python/docs/source/getting_started/install.rst | 17 ++++++++++++++++-
 src/main/python/systemds/context/systemds_context.py    |  2 +-
 4 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/src/main/python/.gitignore b/src/main/python/.gitignore
index 1df6248167..7b0fe3b6b9 100644
--- a/src/main/python/.gitignore
+++ b/src/main/python/.gitignore
@@ -22,3 +22,5 @@ tests/list/tmp
 tests/algorithms/readwrite/
 tests/examples/tutorials/model
 tests/lineage/temp
+
+python_venv/
diff --git a/src/main/python/create_python_dist.py 
b/src/main/python/create_python_dist.py
index f02578fa3a..4718881a36 100755
--- a/src/main/python/create_python_dist.py
+++ b/src/main/python/create_python_dist.py
@@ -23,6 +23,6 @@
 import subprocess
 
 f = open("generator.log","w")
-subprocess.run("python3 generator/generator.py",shell=True, check=True, stdout 
=f, stderr=f)
-subprocess.run("python3 pre_setup.py",shell=True, check=True)
-subprocess.run("python3 setup.py sdist bdist_wheel",shell=True, check=True)
+subprocess.run("python generator/generator.py",shell=True, check=True, stdout 
=f, stderr=f)
+subprocess.run("python pre_setup.py",shell=True, check=True)
+subprocess.run("python setup.py sdist bdist_wheel",shell=True, check=True)
diff --git a/src/main/python/docs/source/getting_started/install.rst 
b/src/main/python/docs/source/getting_started/install.rst
index ddd9c8dc04..b1c783ad9b 100644
--- a/src/main/python/docs/source/getting_started/install.rst
+++ b/src/main/python/docs/source/getting_started/install.rst
@@ -50,7 +50,7 @@ please make sure this is the case.
 Source
 ------
 
-To Install from source involves three steps.
+To Install from source involves multiple steps.
 
 Install Dependencies 
 
@@ -60,6 +60,21 @@ Install Dependencies
 
 Once installed you please verify your version numbers. 
 Additionally you have to install a few python packages.
+We sugest to create a new virtual environment using virtualenv. 
+All commands are run inside src/main/python/.
+We asume that in the following scripts python==python3
+
+  python -m venv python_venv 
+
+Now, we activate the environment.
+
+  source python_venv/bin/activate 
+
+In case of using Linux. For Windows PowerShell use:
+
+  Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
+  python_venv/Scripts/Activate.ps1 
+
 Note depending on your installation you might need to use pip3 instead of pip::
 
   pip install numpy py4j wheel requests
diff --git a/src/main/python/systemds/context/systemds_context.py 
b/src/main/python/systemds/context/systemds_context.py
index a4c89d557e..4cbc6a464d 100644
--- a/src/main/python/systemds/context/systemds_context.py
+++ b/src/main/python/systemds/context/systemds_context.py
@@ -175,7 +175,7 @@ class SystemDSContext(object):
                     [os.path.join(lib_cp, '*'), systemds_cp])
             else:
                 raise ValueError(
-                    "Invalid setup at SYSTEMDS_ROOT env variable path")
+                    "Invalid setup at SYSTEMDS_ROOT env variable path " + 
lib_cp)
         else:
             lib1 = os.path.join(root, "lib", "*")
             lib2 = os.path.join(root, "lib")

Reply via email to