Skip to content

Commit 9245cc5

Browse files
edusperonirigor789
andauthored
feat: simplify macOS 12.3 python setup (#78)
Co-authored-by: Igor Randjelovic <[email protected]>
1 parent f226171 commit 9245cc5

File tree

1 file changed

+10
-28
lines changed

1 file changed

+10
-28
lines changed

environment-setup.md

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -236,41 +236,23 @@ If the binary is not found run `gem env` to examine your folders, and update you
236236

237237
:::warning Important note about macOS 12.3+
238238

239-
Starting with macOS 12.3, python 2.x is no longer shipped with the system and requires you to install it manually.
239+
Starting with macOS 12.3, python 2.x is no longer shipped with the system and the python3 executable isn't aliased to `python`, you will need to do that manually.
240240

241241
If you are on macOS 12.3 or newer, please follow these instructions.
242242

243-
:warning: These instructions may change over time, as we are still evaluating whether or not there's a better approach, but the following should get you running on macOS 12.3+.
244-
245-
First, install **<abbr title="Python version manager">pyenv</abbr>** and [email protected] by running the following:
243+
:warning: **Note**: Python 3 is fully supported by the NativeScript components that rely on it, however changing our scripts to use the `python3` executable name by default is a minor breaking change we're aiming to introduce in NativeScript 8.3. Until then, this workaround is required to get running.
246244

247245
```cli
248-
brew install pyenv
249-
pyenv install 2.7.18
250-
251-
# set the global python version to 2.7.18
252-
pyenv global 2.7.18
253-
254-
# link the installed python version to be available to XCode
255-
sudo ln -s ~/.pyenv/shims/python /usr/local/bin/python
256-
```
257-
258-
To load and initialize pyenv, add the following lines to your shell profile, usually `~/.bash_profile` or `~/.bashrc`, or if you are using `zsh` then `~/.zshrc`:
259-
260-
```bash
261-
if command -v pyenv 1>/dev/null 2>&1; then
262-
eval "$(pyenv init --path)"
263-
eval "$(pyenv init -)"
264-
fi
246+
# link and alias the installed python3
247+
# version to be available to XCode as python
248+
sudo ln -s $(which python3) /usr/local/bin/python
265249
```
266250

267-
**Note:** Make sure to open a new terminal window for the above changes to take effect!
268-
269251
Next, update **<abbr title="Python package manager">pip</abbr>** and install **<abbr title="Python 2 & 3 compatibility package used by NativeScript">six</abbr>** by running the following:
270252

271253
```cli
272-
pip install --upgrade pip
273-
python -m pip install six
254+
python3 -m pip install --upgrade pip
255+
python3 -m pip install six
274256
```
275257

276258
Now continue to the "Install the **NativeScript CLI** globally" section below.
@@ -284,8 +266,8 @@ sudo easy_install pip==20.3.3
284266
python -m pip install six
285267
```
286268

287-
:::tip NOTE
288-
You may see a Deprecation warning when installing **six**, feel free to ignore it for now &mdash; NativeScript will update to Python 3.x in the near future.
269+
:::tip Note
270+
You may see a Deprecation warning when installing **six**, feel free to ignore it for now &mdash; NativeScript will update to Python 3.x in version 8.3.
289271
:::
290272

291273
Install the **NativeScript CLI** globally:
@@ -294,7 +276,7 @@ Install the **NativeScript CLI** globally:
294276
npm install -g nativescript
295277
```
296278

297-
:::tip NOTE
279+
:::tip Note
298280
You may see Deprecation and security warnings from **npm**, these are safe to ignore.
299281

300282
_**More details for those curious:** The NativeScript CLI relies on 3rd party packages that may have been deprecated over the past years. We are slowly replacing these dependencies with newer, supported alternatives to resolve these warnings, however they are generally safe to ignore, since the CLI is never exposed to the public and it's only used for local development, where most of the security concerns don't apply._

0 commit comments

Comments
 (0)