Giter VIP home page Giter VIP logo

electron-python's Introduction

Electron-Python

app Electron GUI communicating with Python backend using zerorpc

Create a python environments (with python3)

//for python3 environment
python -m venv env3

Install dependencies for each virtual environment then exit

Run python environments to install dependencies

It's important to deactivate virtual environments before running electron

Dependencies for python3 env

//env3 for Windows
source env3/Scripts/activate
//env3 macOS/Linux
source env3/bin/activate

pip install -r pycalc/requirements3.txt

Ensure you are using the correct Node version with NVM

We will be using 7.9.0 version of Node, Windows users download NVM for Windows

macOS install NVM using homebrew if node is already installed delete it first

brew uninstall --ignore-dependencies node 
brew uninstall --force node


//Install NVM and refresh terminals path
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash

source ~/.nvm/nvm.sh

NVM should now be installed

//to check if it is installed
nvm --version

We will be using v7.9.0 of Node for this project

nvm install 7.9.0

//to see list of Node versions you have installed
nvm list

// change node version
nvm use 7.9.0

verify version
node --version

Clear caches On Window PowerShell

Remove-Item "(env:USERPROFILE)\.node-gyp" -Force -Recurse -ErrorAction Ignore
Remove-Item "(env:USERPROFILE)\.electron-gyp" -Force -Recurse -ErrorAction Ignore
Remove-Item .\node_modules -Force -Recurse -ErrorAction Ignore

On Linux / OS X

rm -rf ~/.node-gyp
rm -rf ~/.electron-gyp
rm -rf ./node_modules

Install node_modules

npm install --runtime=electron --target=1.7.6

Set the environment variables

export npm_config_target=1.7.6 # electron version
export npm_config_runtime=electron
export npm_config_disturl=https://atom.io/download/electron
export npm_config_build_from_source=true

npm config ls

Electron application will run now

./node_modules/.bin/electron .
//if dynamic linking error shows, clean caches and install node_modules again

To run automated testing run:

npm test

electron-python's People

Contributors

slugb0t avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.