Removed installing packages in the runtime

This commit is contained in:
Ali Parlakci
2018-07-11 23:59:14 +03:00
parent f1a9f1d3e4
commit 2994adea38
3 changed files with 3 additions and 25 deletions

View File

@@ -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

View File

@@ -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
from prawcore.exceptions import NotFound, ResponseException, Forbidden
from src.tools import GLOBAL, createLogFile, jsonFile, printToFile

View File

@@ -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"""