Skip to content

Instantly share code, notes, and snippets.

@kiyoon
Last active May 18, 2022 23:06
Show Gist options
  • Save kiyoon/7dd1d3fefdab686013cb7b98c5cbef3f to your computer and use it in GitHub Desktop.
Save kiyoon/7dd1d3fefdab686013cb7b98c5cbef3f to your computer and use it in GitHub Desktop.
Create Python executable under conda environment
#!/bin/bash
# Make this script executable by
# chmod +x Python_gui_executable_conda.sh
# On Mac,
# go to properties of the file, choose open with, Terminal.app in Utilities folder.
# On Ubuntu you need to make another file.
# Follow the `ubuntu.desktop` script.
source ~/miniconda3/bin/activate
conda activate test_env
python ~/run.py
# https://askubuntu.com/questions/138908/how-to-execute-a-script-just-by-double-clicking-like-exe-files-in-windows
[Desktop Entry]
Type=Application
Terminal=true
Name=Click-Script
Icon=utilities-terminal
Exec=gnome-terminal -e "bash -c './script.sh;$SHELL'"
Categories=Application;
# script.sh should look similar to mac.sh
echo off
cls
D:
cd D:\Python\camera-tools\instagram_tools
"%windir%\System32\cmd.exe" /k ""D:\Python\miniconda3\Scripts\activate.bat" "D:\Python\miniconda3\envs\instatools" && python "D:\Python\camera-tools\instagram_tools\insta_annotate_and_upload.py" && exit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment