Nativescript-cli: WARNING: The Python 'six' package not found.

Created on 18 Apr 2018  ยท  24Comments  ยท  Source: NativeScript/nativescript-cli

_From @obiwankenoobi on April 18, 2018 11:52_

after installing NativeScript on my macos using
ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)"
I ran into error while typing tns doctor which tells me
WARNING: The Python 'six' package not found. and when I trying to install six by pip install six
I get the message : Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.4.1) so there is six installed but yet it wont let me move on because of it

_Copied from original issue: NativeScript/NativeScript#5699_

bug debug mac ios

Most helpful comment

Just reproduced the issue on brand new macOS High Sierra.

Here is what happens:
tns doctor fails because six is not found.
This happens because python -c "import six" fails.
On the other side pip install six says Requirement already satisfied.

Here is how I was able to workaround it:

sudo pip install --upgrade pip
pip install --user --upgrade matplotlib
pip install six

All 24 comments

@obiwankenoobi what is your OS perhaps El Capitan? If so try this solution

pip install --ignore-installed six

Hi @obiwankenoobi,

Can you please try to execute python -c "import six" command and send us the output?

my OS is High Sierra 10.13.4 and pip install --ignore-installed six didnt worked.

$ python -c "import six" Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named six

Hi @obiwankenoobi,

Can you please try to reinstall it?

pip uninstall six
pip install six

$ pip uninstall six Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

I uninstalled NativeScript and reinstalled it and those are the packaged I missing

`There seem to be issues with your configuration.

โœ” Getting NativeScript components versions information...
โœ” Component nativescript has 4.0.0 version and is up to date.

โœ– Component tns-core-modules is not installed.

โœ– Component tns-android is not installed.

โœ– Component tns-ios is not installed.

โœ” Your ANDROID_HOME environment variable is set and points to correct directory.
โœ” Your adb from the Android SDK is correctly installed.
โœ” The Android SDK is installed.
โœ” A compatible Android SDK for compilation is found.
โœ” Javac is installed and is configured properly.
โœ” The Java Development Kit (JDK) is installed and is configured properly.
โœ” Xcode is installed and is configured properly.
โœ” xcodeproj is installed and is configured properly.
โœ” CocoaPods are installed.
โœ” CocoaPods update is not required.
โœ” CocoaPods are configured properly.
โœ” Your current CocoaPods version is newer than 1.0.0.
โœ” Python installed and configured correctly.

โœ– WARNING: The Python 'six' package not found. `

dont know what to do

Hi @obiwankenoobi,

Python six package is needed only for debug command. So all other {N} commands should work as expected.

yeah but I can't tns run ios so how would I test my app without it?

@obiwankenoobi,

Can you try to execute pip install -U six?

`$ pip install -U six
Requirement already up-to-date: six in /Library/Python/2.7/site-packages (1.11.0)

$ tns run ios
โœ” Xcode is installed and is configured properly.
โœ” xcodeproj is installed and is configured properly.
โœ” CocoaPods are installed.
โœ” CocoaPods update is not required.
โœ” CocoaPods are configured properly.
โœ” Your current CocoaPods version is newer than 1.0.0.
โœ” Python installed and configured correctly.
โœ– WARNING: The Python 'six' package not found.
This package is required by the Debugger library (LLDB) for iOS. You can install it by first making sure you have pip installed and then running 'pip install six' from the terminal.`

Just guesting, but it might be related two more than one python available on the machine.

six might be available for one of them, but may be CLI check the other python availalbe on the machine.

@obiwankenoobi If I'm in this cause this is what I'll try:

  1. Run which python, the output should be some path, for example /usr/local/bin/python
  2. Run ls -la on the path to check where it points (run ls -la /usr/local/bin/python in my case)
  3. Then find pip of this python installation (it should be in the same bin folder where python executable is located) and run <path-to-pip>/pip install six.

Just reproduced the issue on brand new macOS High Sierra.

Here is what happens:
tns doctor fails because six is not found.
This happens because python -c "import six" fails.
On the other side pip install six says Requirement already satisfied.

Here is how I was able to workaround it:

sudo pip install --upgrade pip
pip install --user --upgrade matplotlib
pip install six

Hi @obiwankenoobi,

Do you have the chance to try the above suggestion?

The solution proposed by dtopuzov fixes the issue on MacOS High Sierra 10.13.4

@Fatme
The solution above makes doctor happy, but most likely it happens on all brand new macOS High Sierra machines.
I think we should check if we still need this python package.
I think it was required for debug with iOS inspector, which now is not the default option.

May be we can also consider doing this check only when user try to use the command that need this package.

Also works on 10.13.6 plus I had to first install pip.
sudo easy_install pip

then, only
pip install --user --upgrade matplotlib
pip install six

The first command failed on ownership and lack of cache setting.

Without this, Sidekick failed to instantiate it's user interface.

I had the same issue. I solved it with listing modules

(Python 2.7.15)
pip2 list
and
(Python 3.6.5)
pip3 list

tns uses pip2 in my case (Mac 10.13.6)

I did
pip2 install six

after that

tns doctor fund six package

I am just installing local files to build local NS projects.

Output tns doctor

MacBook-Pro-7:TestApp augustopissarra$ tns doctor
โœ” Getting environment information

There seem to be issues with your configuration.
โœ” Getting NativeScript components versions information...
โœ” Component nativescript has 5.0.0 version and is up to date.
โœ” Component tns-core-modules has 5.0.2 version and is up to date.
โœ” Component tns-android has 5.0.0 version and is up to date.
โœ” Component tns-ios has 5.0.0 version and is up to date.
โœ” Your ANDROID_HOME environment variable is set and points to correct directory.
โœ” Your adb from the Android SDK is correctly installed.
โœ” The Android SDK is installed.
โœ” A compatible Android SDK for compilation is found.
โœ” Javac is installed and is configured properly.
โœ” The Java Development Kit (JDK) is installed and is configured properly.
โœ” Xcode is installed and is configured properly.
โœ” xcodeproj is installed and is configured properly.
โœ” CocoaPods are installed.
โœ” CocoaPods update is not required.
โœ” CocoaPods are configured properly.
โœ” Your current CocoaPods version is newer than 1.0.0.
โœ” Python installed and configured correctly.
โœ” Xcode version 10.1.0 satisfies minimum required version 9.
โœ– WARNING: The Python 'six' package not found.
This package is required by the Debugger library (LLDB) for iOS. You can install it by first making sure you have pip installed and then running 'pip install six' from the terminal.

I am using Mac OS 10.14.1 (Mojave)

I have tried all of the above, none solved the issue.

After many trials and errors, not sure if it will fix again but, I used the following command:

sudo pip install --ignore-installed  --upgrade six

I removed the sudo to check the version. Latest is 1.11.0.

I had to run the following to fix the issue

brew uninstall --force --ignore-dependencies python@2
brew uninstall --force --ignore-dependencies python
brew install python
brew install python@2

Solution for Mac OS Catalina.
Set your PYTHONPATH environment variable to /Library/Python/2.7/site-packages.

You can do this for your current termincal instance with:
export PYTHONPATH=/Library/Python/2.7/site-packages

OR add it permanently to your ~/.bash_profile file. (note you will need to restart your terminal window after doing this.)

See:
https://stackoverflow.com/questions/29485741/unable-to-upgrade-python-six-package-in-mac-osx-10-10-2

I couldn't get NativeScript to switch to my Python 3 installation, and my system Python 2 framework didn't have pip. sudo easy_install pip did not work for me. The following did:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
Then I needed the full path to the new pip2 installation, which was given during the installation above. Copy yours from the installation message; my path and the rest of the command for installing six looked like this:
/Users/matt/Library/Python/2.7/bin/pip2 install six

I have run a few commands, and after run this "python -m pip install --upgrade six", I tried again, and it works. Maybe you can try run this first to see if if fixed or not.

for me help.
pip3 install --ignore-installed six
If you are not have pip3 install it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leevigraham picture leevigraham  ยท  3Comments

NickIliev picture NickIliev  ยท  3Comments

Fatme picture Fatme  ยท  3Comments

ZMW9 picture ZMW9  ยท  3Comments

kefahB picture kefahB  ยท  3Comments