Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it necessary to install Python for react-native on windows for "react-native init AwesomeProject"?

I am trying to setup react-native on windows7.

I have following things installed:

C:\Windows\system32>node -v
v6.2.0    
C:\Windows\system32>npm -v
3.8.9    
C:\Windows\system32>javac -version
javac 1.8.0_60

I have not installed Python. When i try react-native init AwesomeProject only 2 things are downloaded in AwesomeProject: node_modules dir and

package.json

{
  "name": "AwesomeProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "react-native": "0.41.2"
  }
}

It is incomplete project. ReactNative0.41 Docs says

We recommend installing Node.js and Python2.

Why Python is recommended with react-native? Does react-native requires python to clone the seed project?

I have installed following things as well:

  • Android SDK
  • Android SDK Platform
  • Android Virtual Device
  • Android 6.0 SDK tools
  • Google APIs
  • Intel x86 Atom System Image
  • Intel x86 Atom_64 System Image
  • Google APIs Intel x86 Atom_64 System Image
like image 331
Arun Kumar Avatar asked Feb 24 '17 15:02

Arun Kumar


People also ask

Is Python necessary for React Native?

Python is needed to run the React Native build scripts. Run the following command as Administrator if you don't have Python 2. Run the following command as Administrator if you don't have a JDK or have a version older than 8. Install Node.

Does react need Python?

This is because React uses a very different syntax and data structures than Python, which makes it difficult for Python developers to adapt to. In this article, we'll map out a road plan for getting started with React, as well as the core prerequisites for diving into React as a Python developer.

Does React Native work with Python?

python3 and python2, both works well with react-native. In Ubuntu default installed python version is 2.7 , and no need to install python 3 separately. :) @avigil It is very easy to try.

How do I set up React Native in Windows 10?

Get started with React Native by installing required toolsInstall Visual Studio Code (or your code editor of choice). Install Android Studio for Windows. Android Studio installs the latest Android SDK by default. React Native requires Android 6.0 (Marshmallow) SDK or later.


1 Answers

Yes, Python is needed. Download the newest Python 2 release and install it.

The reason why it's used is because React Native's build system is 100% based on it. It is used to compile your source code and serve it during development mode. In the same way that some build systems are based in JS using, say, Webpack, theirs is just a collection of Python scripts.

Facebook, in general, relies on Python a lot for build workflows.

like image 79
zeh Avatar answered Sep 28 '22 07:09

zeh