Skip to content

Commit 5a86c33

Browse files
committed
Fixed bug in determining path to site-packages.
1 parent 4f1d422 commit 5a86c33

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

hide_code/hide_code.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def install(nb_path=None, DEBUG=False):
1313
print('Starting hide_code.js install...')
1414
current_dir = path.abspath(path.dirname(__file__))
1515
config_dirs = j_path.jupyter_config_path()
16-
site_packages_path = path.join(os.__file__[:-7], "site-packages")
16+
site_packages_path = get_site_package_dir()
1717

1818
# check for config directory with a "custom" folder
1919
# TODO update this logic to check if custom.js file exists
@@ -64,4 +64,11 @@ def install(nb_path=None, DEBUG=False):
6464
else:
6565
print('Unable to install into ' + install_path)
6666
print('Directory doesn\'t exist.')
67-
print('Make sure Jupyter is installed.')
67+
print('Make sure Jupyter is installed.')
68+
69+
def get_site_package_dir():
70+
os_file = os.__file__
71+
if os_file.endswith('c'):
72+
return path.join(os_file[:-7], "site-packages")
73+
else:
74+
return path.join(os_file[:-6], "site-packages")

0 commit comments

Comments
 (0)