Skip to content

Commit

Permalink
add clarification.. but maybe this is not the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
zeffii committed Jul 13, 2022
1 parent a7b7288 commit 78ef71e
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions node_scripts/SNLite_templates/templates/pip_install_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
in package s
"""

#
#
# this example should not be run as a script inside script node, it exists only to give users
# quick access to a scripted version of pip-install :
#
# you can pass it a package name, or a list of package names
# you can pass it a local whl location
#
# below are examples of lines that you can execute using these two functions, they will call subprocess
# and install the packages into the current bpython executable's site-packages directory.

import sys
import os
import subprocess
Expand All @@ -14,15 +25,14 @@ def install_package(package):
def install_whl(package_path):
subprocess.call([os.path.join(sys.prefix, 'bin', 'python.exe'), "-m", "pip", "install", f"{package_path}"])

'''
if __name__ == '__main__':
## install_package(['--upgrade', 'pip']) # <-- may not be needed
# install_package('pandas')
## install_package('gdal') # <-- may fail
## install_package('fiona') # <-- may fail.
# install_whl(r"C:\Users\zeffi\Downloads\GDAL-3.4.2-cp310-cp310-win_amd64.whl")
# install_whl(r"C:\Users\zeffi\Downloads\Fiona-1.8.21-cp310-cp310-win_amd64.whl")
# install_package('geopandas')
# install_package('pygeos') # <-- optional
# install_package('shapely') # <-- optional
'''
#if __name__ == '__main__':
# install_package(['--upgrade', 'pip']) # <-- may not be needed
# install_package('pandas')
# install_package('gdal') # <-- may fail
# install_package('fiona') # <-- may fail.
# install_whl(r"C:\Users\zeffi\Downloads\GDAL-3.4.2-cp310-cp310-win_amd64.whl")
# install_whl(r"C:\Users\zeffi\Downloads\Fiona-1.8.21-cp310-cp310-win_amd64.whl")
# install_package('geopandas')
# install_package('pygeos')
# install_package('shapely')

0 comments on commit 78ef71e

Please sign in to comment.