Skip to content

Commit

Permalink
Fix an issue with Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuminjie committed Sep 16, 2020
1 parent d16fd50 commit 31a53df
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions openseespy-pip/openseespy/opensees/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import ctypes

# only work for 64 bit system
if sys.maxsize < 2**31:
Expand All @@ -14,13 +15,15 @@

elif sys.platform.startswith('win'):

# try:
# from openseespy.opensees.win.opensees import *
# except:
# raise RuntimeError('Failed to import openseespy.')
# python 3.7 is required
if sys.version_info[0] == 3 and sys.version_info[1] == 8:

dll_path = ''
for path in sys.path:
if 'DLLs' in path:
dll_path = path
break
ctypes.cdll.LoadLibrary(dll_path + '\\tcl86t.dll')

try:
from openseespy.opensees.win.opensees import *

Expand All @@ -33,18 +36,6 @@
raise RuntimeError(
'Python version 3.8 is needed for Windows')

# if sys.version_info[1] == 6:

# from openseespy.opensees.winpy36.opensees import *

# elif sys.version_info[1] == 7:

# from openseespy.opensees.winpy37.opensees import *

# elif sys.version_info[1] == 8:

# from openseespy.opensees.winpy38.opensees import *

elif sys.platform.startswith('darwin'):

# from openseespy.opensees.mac.opensees import *
Expand Down

0 comments on commit 31a53df

Please sign in to comment.