|
76 | 76 | fp = open(G2bat,'w') |
77 | 77 | fp.write("@REM created by run of makeBat.py on {:%d %b %Y %H:%M}\n".format( |
78 | 78 | 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') |
80 | 81 | print("Looking for",activate) |
81 | 82 | # for a non-base conda install, it might be better to use the activate in |
82 | 83 | # the base, but for now let's use the one we find relative to our python |
83 | 84 | if os.path.exists(activate): |
84 | 85 | activate = os.path.realpath(activate) |
85 | 86 | if ' ' in activate: |
86 | | - activate = 'call "'+ activate + '"\n' |
| 87 | + activate = f'call "{activate}" activate\n' |
87 | 88 | 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})') |
90 | 91 | 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+'"' |
95 | 96 | G2s = G2script |
96 | 97 | if ' ' in G2s: G2s = '"'+G2script+'"' |
97 | | - fp.write(Script.format(activate,pexe,G2s)) |
| 98 | + fp.write(Script.format(activate,'python.exe',G2s)) |
98 | 99 | fp.close() |
99 | 100 | print(f'\nCreated GSAS-II batch file {G2bat}') |
100 | 101 |
|
|
0 commit comments