Removed installing packages in the runtime
This commit is contained in:
parent
f1a9f1d3e4
commit
2994adea38
|
@ -4,19 +4,13 @@ import sys
|
|||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
import imgurpython
|
||||
|
||||
from src.errors import (AlbumNotDownloadedCompletely, FileAlreadyExistsError,
|
||||
FileNameTooLong, ImgurLoginError,
|
||||
NotADownloadableLinkError)
|
||||
from src.tools import GLOBAL, nameCorrector, printToFile
|
||||
|
||||
try:
|
||||
from imgurpython import *
|
||||
except ModuleNotFoundError:
|
||||
print("\nimgurpython not found on your computer, installing...\n")
|
||||
from src.tools import install
|
||||
install("imgurpython")
|
||||
from imgurpython import *
|
||||
|
||||
VanillaPrint = print
|
||||
print = printToFile
|
||||
|
||||
|
|
|
@ -3,14 +3,7 @@ import random
|
|||
import socket
|
||||
import webbrowser
|
||||
|
||||
try:
|
||||
import praw
|
||||
except ModuleNotFoundError:
|
||||
print("\nPRAW not found on your computer, installing...\n")
|
||||
from src.tools import install
|
||||
install("praw")
|
||||
import praw
|
||||
|
||||
import praw
|
||||
from prawcore.exceptions import NotFound, ResponseException, Forbidden
|
||||
|
||||
from src.tools import GLOBAL, createLogFile, jsonFile, printToFile
|
||||
|
|
|
@ -2,20 +2,11 @@ import io
|
|||
import json
|
||||
import sys
|
||||
import time
|
||||
|
||||
try:
|
||||
from pip import main as pipmain
|
||||
except:
|
||||
from pip._internal import main as pipmain
|
||||
|
||||
from os import makedirs, path, remove
|
||||
from pathlib import Path
|
||||
|
||||
from src.errors import FileNotFoundError
|
||||
|
||||
def install(package):
|
||||
pipmain(['install', package])
|
||||
|
||||
class GLOBAL:
|
||||
"""Declare global variables"""
|
||||
|
||||
|
|
Loading…
Reference in a new issue