Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX#4324: Add verbose errors during init in evaluate method #4324 #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 32 additions & 12 deletions evaluation_script/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,45 @@ def install(package):

# Args:
# package ([str]): Package name with version

subprocess.check_call([sys.executable, "-m", "pip", "install", package])

try:
subprocess.check_call([
sys.executable,
"-m",
"pip",
"install",
package
])
except FileNotFoundError:
print("Error: Pip not found.")
except PermissionError:
print("Error: Permission denied. ")
except subprocess.CalledProcessError as e:
print("Error installing package:", e)

def install_local_package(folder_name):
# Install a local python package

# Args:
# folder_name ([str]): name of the folder placed in evaluation_script/

subprocess.check_output(
[
sys.executable,
"-m",
"pip",
"install",
os.path.join(str(Path(__file__).parent.absolute()) + folder_name),
]
)

try:
subprocess.check_output(
[
sys.executable,
"-m",
"pip",
"install",
os.path.join(str(Path(__file__).parent.absolute()) + folder_name),
]
)
except FileNotFoundError:
print("Error: Pip not found.")
except PermissionError:
print("Error: Permission denied. ")
except subprocess.CalledProcessError as e:
print("Error installing local package:", e)


install("shapely==1.7.1")
install("requests==2.25.1")
Expand Down