Skip to content

Commit 1c22809

Browse files
committed
Switch from activate.bat to conda.bat
1 parent 270d672 commit 1c22809

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

GSASII/install/makeBat.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,26 @@
7676
fp = open(G2bat,'w')
7777
fp.write("@REM created by run of makeBat.py on {:%d %b %Y %H:%M}\n".format(
7878
datetime.datetime.now()))
79-
activate = os.path.join(os.path.split(pythonexe)[0],'Scripts','activate')
79+
#activate = os.path.join(os.path.split(pythonexe)[0],'Scripts','activate')
80+
activate = os.path.join(os.path.split(pythonexe)[0],'condabin','conda.bat')
8081
print("Looking for",activate)
8182
# for a non-base conda install, it might be better to use the activate in
8283
# the base, but for now let's use the one we find relative to our python
8384
if os.path.exists(activate):
8485
activate = os.path.realpath(activate)
8586
if ' ' in activate:
86-
activate = 'call "'+ activate + '"\n'
87+
activate = f'call "{activate}" activate\n'
8788
else:
88-
activate = 'call '+ activate + '\n'
89-
print(f'adding activate to .bat file ({activate})')
89+
activate = f'call {activate} activate\n'
90+
print(f'adding activate command to .bat file\n({activate})')
9091
else:
91-
print('conda activate not found')
92-
activate = ''
93-
pexe = pythonexe
94-
if ' ' in pythonexe: pexe = '"'+pythonexe+'"'
92+
print('Note: conda activate not found')
93+
activate = '@REM no activate command found'
94+
#pexe = pythonexe
95+
#if ' ' in pythonexe: pexe = '"'+pythonexe+'"'
9596
G2s = G2script
9697
if ' ' in G2s: G2s = '"'+G2script+'"'
97-
fp.write(Script.format(activate,pexe,G2s))
98+
fp.write(Script.format(activate,'python.exe',G2s))
9899
fp.close()
99100
print(f'\nCreated GSAS-II batch file {G2bat}')
100101

0 commit comments

Comments
 (0)