Merge branch 'pr/9957': run_electrum: improve check_imports()
merges https://github.com/spesmilo/electrum/pull/9957
This commit is contained in:
@@ -6,7 +6,7 @@ is_bundle = getattr(sys, 'frozen', False)
|
|||||||
is_local = not is_bundle and os.path.exists(os.path.join(os.path.dirname(os.path.dirname(__file__)), "electrum.desktop"))
|
is_local = not is_bundle and os.path.exists(os.path.join(os.path.dirname(os.path.dirname(__file__)), "electrum.desktop"))
|
||||||
|
|
||||||
# when running from source, on Windows, also search for DLLs in inner 'electrum' folder
|
# when running from source, on Windows, also search for DLLs in inner 'electrum' folder
|
||||||
if is_local and os.name == 'nt':
|
if is_local and os.name == 'nt': # fixme: duplicated between main script and __init__.py :(
|
||||||
os.add_dll_directory(os.path.dirname(__file__))
|
os.add_dll_directory(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
12
run_electrum
12
run_electrum
@@ -65,6 +65,11 @@ if is_pyinstaller:
|
|||||||
_file = open(sys.executable, 'rb')
|
_file = open(sys.executable, 'rb')
|
||||||
|
|
||||||
|
|
||||||
|
# when running from source, on Windows, also search for DLLs in inner 'electrum' folder
|
||||||
|
if is_local and os.name == 'nt': # fixme: duplicated between main script and __init__.py :(
|
||||||
|
os.add_dll_directory(os.path.join(os.path.dirname(__file__), 'electrum'))
|
||||||
|
|
||||||
|
|
||||||
def check_imports():
|
def check_imports():
|
||||||
# pure-python dependencies need to be imported here for pyinstaller
|
# pure-python dependencies need to be imported here for pyinstaller
|
||||||
try:
|
try:
|
||||||
@@ -73,8 +78,13 @@ def check_imports():
|
|||||||
import qrcode
|
import qrcode
|
||||||
import google.protobuf
|
import google.protobuf
|
||||||
import aiorpcx
|
import aiorpcx
|
||||||
|
import aiohttp
|
||||||
|
import aiohttp_socks
|
||||||
|
import electrum_ecc
|
||||||
|
import jsonpatch
|
||||||
|
import electrum_aionostr
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
sys.exit(f"Error: {str(e)}. Try 'sudo python3 -m pip install <module-name>'")
|
sys.exit(f"Error: {str(e)}. Some dependencies are missing. Have you read the README? Or just try '$ python3 -m pip install -r contrib/requirements/requirements.txt'")
|
||||||
if not ((0, 25, 0) <= aiorpcx._version < (0, 26)):
|
if not ((0, 25, 0) <= aiorpcx._version < (0, 26)):
|
||||||
raise RuntimeError(f'aiorpcX version {aiorpcx._version} does not match required: 0.25.0<=ver<0.26')
|
raise RuntimeError(f'aiorpcX version {aiorpcx._version} does not match required: 0.25.0<=ver<0.26')
|
||||||
# the following imports are for pyinstaller
|
# the following imports are for pyinstaller
|
||||||
|
|||||||
Reference in New Issue
Block a user