Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing xcode dependency: Python module "six" #16428

Closed
u84six opened this Issue Apr 10, 2018 · 48 comments

Comments

@u84six
Copy link

u84six commented Apr 10, 2018

Steps to Reproduce

On macOS High Sierra

  • Install Flutter
  • Run Flutter Doctor

Everything is checked except for "Missing Xcode dependency: Python module "six". Install via 'pip install six' or 'sudo easy_install six'."

I have both the built-in macOS dependent Python2.7 as well as Python3.6 (latest). I ran both pip and pip3 commands to install six. Then ran Flutter Doctor again. Still the same error. Then tried 'sudo easy_install six'. Still the same error in Flutter Doctor.

Edit: got this error when trying to install six:

Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.4.1)
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible.

Tried to install the 3 module mentioned above:
sudo pip install nose
Collecting nose
Downloading nose-1.3.7-py2-none-any.whl (154kB)
100% |████████████████████████████████| 163kB 3.7MB/s
matplotlib 1.3.1 requires tornado, which is not installed.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible.
Installing collected packages: nose
Consider using the --user option or check the permissions

I believe that I can't install anything for the macOS default version of Python because it will break lower level dependencies within the OS.

I then uninstalled Python3.6 (which was a pain to find all the directories associated with it), as well as all the symlinks. Reinstalled Python3.6, ran Flutter Doctor. Still the same error. Restarted, etc, still the same error.

Also, if I try to make Python3.6 the default python on the mac, it will likely break OS level services that depend on python2.7.

Please tell us what you were doing and what went wrong. If you are running flutter tools from the command line, please try adding the -v or --verbose option to gather more information.

I'm not even at the stage of building a flutter app yet. Just trying to install and setup.

Flutter Doctor

Paste the output of running flutter doctor -v here.
flutter doctor -v
[✓] Flutter (Channel beta, v0.2.8, on Mac OS X 10.13.3 17D102, locale en-US)
• Flutter version 0.2.8 at /Users/myname/Development/flutter/flutter
• Framework revision b397406 (8 days ago), 2018-04-02 13:53:20 -0700
• Engine revision c903c21
• Dart version 2.0.0-dev.43.0.flutter-52afcba357

[✓] Android toolchain - develop for Android devices (Android SDK 25.0.2)
• Android SDK at /Users/myname/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-25, build-tools 25.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
✗ Missing Xcode dependency: Python module "six".
Install via 'pip install six' or 'sudo easy_install six'.
• ios-deploy 1.9.2
• CocoaPods version 1.5.0

[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Connected devices (1 available)
• iPhone 7 • E8EF95FA-8E51-44F3-BF6D-AA12032481F3 • ios • iOS 11.2 (simulator)

@uinz

This comment has been minimized.

Copy link

uinz commented Apr 11, 2018

try python2.x -m pip install six by @humblerookie's suggest

or

brew reinstall python@2
pip install six

@SilDev

This comment has been minimized.

Copy link

SilDev commented Apr 11, 2018

I had the same issue, @uinz answer works for me!

@celioabreu

This comment has been minimized.

Copy link

celioabreu commented Apr 11, 2018

Fantastic !!!

@u84six

This comment has been minimized.

Copy link
Author

u84six commented Apr 11, 2018

@uinz's answer worked. Thank you!

@BrelanAllin

This comment has been minimized.

Copy link

BrelanAllin commented Apr 12, 2018

Have been wracking my brain trying to get it to work and uinz comes in with the save!

@bssPhongNguyen

This comment has been minimized.

Copy link

bssPhongNguyen commented Apr 13, 2018

thank God and thank @uinz, it works now!

@karanatwal

This comment has been minimized.

Copy link

karanatwal commented Apr 13, 2018

Thanks alot @uinz . You save my precious time. 🥇

@ashtonthomas

This comment has been minimized.

Copy link

ashtonthomas commented Apr 14, 2018

🔥

thank you 🙏

@humblerookie

This comment has been minimized.

Copy link

humblerookie commented Apr 23, 2018

@uinz Could you update your answer with this

python2.x -m pip install six

for people using parallel python installations (me being one of them). Took a lot of time to figure this out :/

@uinz

This comment has been minimized.

Copy link

uinz commented Apr 23, 2018

@humblerookie

I updated my answer but I am not sure about it.

@humblerookie

This comment has been minimized.

Copy link

humblerookie commented Apr 24, 2018

@uinz Thanks a lot :). May I know what makes you sceptic? I'll try to elaborate my issue.

The root cause for me is the fact that Mac Os Sierra uses python 2.x and when you manage to install a parallel python3 things go south with the flutter installation since the pip installer defaults to 3.x installation directory instead of OS default i.e 2.x and flutter doc doesn't detect it.

You're original solution would be perfect if people haven't installed python 3 side by side. The latter one worked for me but I guess maybe its just me.

@jjyy1008

This comment has been minimized.

Copy link

jjyy1008 commented Apr 24, 2018

@uinz 's answer worked. Thanks.

@uinz

This comment has been minimized.

Copy link

uinz commented Apr 25, 2018

@humblerookie

I'm not familiar with python

But I install python3 by brew install python@3

brew told me that I can use pip3 to install package.

@ronaldxian

This comment has been minimized.

Copy link

ronaldxian commented Apr 26, 2018

@uinz thank you

@brunosansigolo

This comment has been minimized.

Copy link

brunosansigolo commented Apr 27, 2018

@uinz thank you!

@mikebriseno

This comment has been minimized.

Copy link

mikebriseno commented Apr 28, 2018

@uinz that worked like a charm, thanks!

brew reinstall python@2
pip install six

@chrislambe

This comment has been minimized.

Copy link

chrislambe commented Apr 29, 2018

Prior to running python2.x -m pip install six, I had to run python2.x -m ensurepip --default-pip to ensure that my Python 2.x install had pip available.

@Kenny1610

This comment has been minimized.

Copy link

Kenny1610 commented Apr 30, 2018

@uinz I tried literally every option and when I run flutter doctor -v, I get

[✓] Flutter (Channel beta, v0.2.8, on Mac OS X 10.13.4 17E199, locale en-US)
• Flutter version 0.2.8 at /Users/The_Chosen_King/Downloads/flutter
• Framework revision b397406 (4 weeks ago), 2018-04-02 13:53:20 -0700
• Engine revision c903c21
• Dart version 2.0.0-dev.43.0.flutter-52afcba357

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/The_Chosen_King/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.3, Build version 9E145
• ios-deploy 1.9.2
• CocoaPods version 1.5.0

[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Connected devices (2 available)
• Kendall • 2cd6bdf3effa50c19ca810fe70edbe5b3d14362c • ios • iOS 11.3
• iPhone X • 81EAB622-6A06-499C-A9BD-89BE71BF8910 • ios • iOS 11.3 (simulator)

• No issues found!

Everything is said to be working fine until I try to debug and run the the original code when you start a new flutter project and I get this:

Missing Xcode dependency: Python module "six".
Install via 'pip install six' or 'sudo easy_install six'.
Could not build the application for the simulator.
Error launching application on iPhone X.

I don't know what else to do to get this to work.

@humblerookie

This comment has been minimized.

Copy link

humblerookie commented May 2, 2018

@Kenny1610 Whats the output for your 'six' installation?

@Belliott404

This comment has been minimized.

Copy link

Belliott404 commented May 2, 2018

@uinz thank you!!!

@Kenny1610

This comment has been minimized.

Copy link

Kenny1610 commented May 2, 2018

@humblerookie my output for that is:
Requirement already satisfied: six in /Users/The_Chosen_King/anaconda3/lib/python3.6/site-packages (1.11.0)

@humblerookie

This comment has been minimized.

Copy link

humblerookie commented May 2, 2018

@Kenny1610 clearly the case is that six is installed in python 3.6 and your system python is 2.x so six is being looked up in 2.x repo and is not found.

what's the output for?

ls /usr/local/Frameworks/Python.framework/Versions

if it has 2.7 then try

python2.7 -m pip install six

else insert the appropriate 2.x version number

@Kenny1610

This comment has been minimized.

Copy link

Kenny1610 commented May 2, 2018

@humblerookie 2.7 is the current version, so I ran the 'python2.7 -m pip install six' command and got:
Collecting six
Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six
Successfully installed six-1.11.0

I tried running the program again and still got the exact same error for some reason.

@humblerookie

This comment has been minimized.

Copy link

humblerookie commented May 2, 2018

@Kenny1610 try uninstalling it and then using "python2.7 -m pip install six". Should work.

@Kenny1610

This comment has been minimized.

Copy link

Kenny1610 commented May 2, 2018

@humblerookie I tried a lot of those commands in the link you provided and it's not uninstalling like it should. I believe I might not be entering the the correct value for 'packages'. I'm new to this kind of stuff. I apologize.

@toddtyler

This comment has been minimized.

Copy link

toddtyler commented May 2, 2018

Thanks @uinz, your comment solved the issue for me.

@krasavello13

This comment has been minimized.

Copy link

krasavello13 commented May 6, 2018

I had the same issue, @uinz answer works for me!

@AppleEducate

This comment has been minimized.

Copy link

AppleEducate commented May 7, 2018

@uinz answer worked for me.

@kangmaman

This comment has been minimized.

Copy link

kangmaman commented May 8, 2018

If you have already installed Python 3 on MacOS, just copy file six.py to folder /usr/local/lib/python2.7/site-packages.

You can get file six.py from https://github.com/benjaminp/six

"...Six supports every Python version since 2.6. It is contained in only one Python file, so it can be easily copied into your project. (The copyright and license notice must be retained.)..."

@liangerzhao

This comment has been minimized.

Copy link

liangerzhao commented May 9, 2018

@uinz thank you!!!!!

@vakenbolt

This comment has been minimized.

Copy link

vakenbolt commented May 11, 2018

Christ! This one of the many reasons I loathe Python and it's ecosystem. Can we at least get accurate messaging in flutter doctor? For MacOS users the messages related to missing python dependencies is cloudy at best.

[!] iOS toolchain - develop for iOS devices (Xcode 9.3)
    ✗ Missing Xcode dependency: Python module "six".

      MacOS users that have Apple's version Python need to reinstall before using pip to install six.
              e.g. brew reinstall python@2

      Install via 'pip install six' or 'sudo easy_install six'.

Clarity is our friend.

@mit-mit

This comment has been minimized.

Copy link
Member

mit-mit commented May 14, 2018

cc @cbracken I think this is the issue I showed to you last week. Is there anything you can think off we can do to mitigate this?

@Sun3

This comment has been minimized.

Copy link

Sun3 commented May 15, 2018

I have reformatted two different Mac Computers with macOS Sierra but received the same errors:

Missing Xcode dependency: Python module "six".
Install via 'pip install six' or 'sudo easy_install six'.
Could not build the application for the simulator.
Error launching application on iPhone X.

Was there any progress on this issue?

#Flutter Doctor -v

flutter doctor -v
[✓] Flutter (Channel beta, v0.3.2, on Mac OS X 10.13.4 17E202, locale en-US)
    • Flutter version 0.3.2 at /Users/marco/Development/flutter
    • Framework revision 44b7e7d3f4 (4 weeks ago), 2018-04-20 01:02:44 -0700
    • Engine revision 09d05a3891
    • Dart version 2.0.0-dev.48.0.flutter-fe606f890b

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/marco/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[!] iOS toolchain - develop for iOS devices (Xcode 9.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3.1, Build version 9E501
    ✗ Missing Xcode dependency: Python module "six".
      Install via 'pip install six' or 'sudo easy_install six'.
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.2

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 24.2.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Connected devices (2 available)
    • Android SDK built for x86 • emulator-5554                        • android-x86 • Android 8.1.0 (API 27) (emulator)
    • iPhone X                   • ios         • iOS 11.3 (simulator)

! Doctor found issues in 2 categories.

Thank you

@cbracken

This comment has been minimized.

Copy link
Member

cbracken commented May 15, 2018

@mit-mit this comes down to a bug (mis-feature?) in Xcode, which is that it's using the version of python at the front of the PATH as opposed to the system-default python it expects. Xcode itself relies on the six module, so it'll need to be installed in whichever python is at the front of the PATH.

As a temporary workaround, I'd suggest everyone run which python and which pip and ensure that they're consistent with each other, then pip install six to get the six module installed in that version.

One thing I'll look into is whether we can stomp on any user-customisations to the PATH just for the duration of any Xcode invocations. That's certainly doable for invocations via the flutter tool itself, but I'm not 100% certain it'll work for Xcode builds that occur from the Xcode UI -- it'll depend on whether the error is occurring during the build of the Obj-C/Swift bits of the app or during our build of the AOT assembly.

@Sun3

This comment has been minimized.

Copy link

Sun3 commented May 18, 2018

Running the commands get rid of the pip six error but... when you compile a project for release you receive an error:

brew reinstall python@2
pip install six

Error by running -> flutter run --release to an actual device like an iPhone

flutter run --release
Launching lib/main.dart on Marco’s iPhone in release mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: W4DESGH8Y9
Running Xcode clean...                                       1.1s
Starting Xcode build...                                          
 ├─Building Dart code...                             24.3s
 ├─Assembling Flutter resources...                    1.1s
 └─Compiling, linking and signing...                  9.4s
Xcode build done.                                           36.8s
Installing and launching...                                      
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 52, in <module>
    import weakref
  File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref

To repeat this help message, press "h". To quit, press "q".
@jjavierweb

This comment has been minimized.

Copy link

jjavierweb commented May 20, 2018

@uinz worked like really good, thanks a lot

@TimZ99

This comment has been minimized.

Copy link

TimZ99 commented May 20, 2018

Didn't work for me, unfortunately.
Getting this message every time I run flutter run.

@opyate

This comment has been minimized.

Copy link

opyate commented Jun 5, 2018

A note for anyone getting No module named pip and who can't install pip using the usual methods because environment, you can try this:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python2.7 get-pip.py

Then @uinz 's answer will work:

python2.7 -m pip install six
@Sun3

This comment has been minimized.

Copy link

Sun3 commented Jun 5, 2018

The curl works good, but when you run the python2.7 get-pip.py you get errors

matplotlib 1.3.1 requires tornado, which is not installed.

@uinz solution then gives same error as above.

@emaalouf

This comment has been minimized.

Copy link

emaalouf commented Jun 8, 2018

@uinz answer helped so much, Thanks

@zeasin

This comment has been minimized.

Copy link

zeasin commented Jun 11, 2018

🔥

thank you @uinz 🙏

@toventang

This comment has been minimized.

Copy link

toventang commented Jun 24, 2018

@opyate well done! thanks s

@MurphLu

This comment has been minimized.

Copy link

MurphLu commented Jun 26, 2018

@uinz thank you

@CodingWasaby

This comment has been minimized.

Copy link

CodingWasaby commented Jul 8, 2018

@uinz u r my hero

@cbracken

This comment has been minimized.

Copy link
Member

cbracken commented Jul 12, 2018

Fixed in #19281 on master. It should no longer be necessary to manually install the six module if you have a custom Python install on your path.

@cbracken cbracken closed this Jul 12, 2018

@cbracken cbracken self-assigned this Jul 12, 2018

@cbracken cbracken added this to Done in cbracken tasks Jul 12, 2018

@abnerh69

This comment has been minimized.

Copy link

abnerh69 commented Jul 31, 2018

Just in case you (as me) have python version 2 AND python version 3 installed on your system... you need to tell pip version to install six, this was my solution:

pip2 install six

Hope this works for any in same situation.

@bestswifter

This comment has been minimized.

Copy link

bestswifter commented Aug 12, 2018

If you get an error like No module named 'zlib', this may help you: Homebrew/homebrew-core#29176

@kenanduman1988

This comment has been minimized.

Copy link

kenanduman1988 commented Oct 9, 2018

try python2.x -m pip install six by @humblerookie's suggest

or

brew reinstall python@2
pip install six

Thanks man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.