Questions tagged [six]

Six provides simple utilities for wrapping over differences between Python 2 and Python 3.

Six provides simple utilities for wrapping over differences between and . It is intended to support codebases that work on both Python 2 and 3 without modification. six consists of only one Python file, so it is painless to copy into a project.

147 questions
1
vote
1 answer

enumerate with six library in python dictionary

I can use enumerate with python dictionary like so: for count, (key, value) in enumerate(my_dict.iteritems(), 1): print key, value, count How do I use enumerate with the iteritems function from the six library?
user308827
  • 21,227
  • 87
  • 254
  • 417
1
vote
2 answers

Want to install six and It gives me the error " No module named 'six' "

I get following error: fhem@raspberrypi:/home/pi/Downloads$ sudo pip install six-1.10.0.tar.gz Traceback (most recent call last): File "/usr/local/bin/pip", line 6, in from pkg_resources import load_entry_point File…
Jhidzzo
  • 77
  • 10
1
vote
2 answers

When I try to compile and .exe I get ImportError: No module named six

I've tried making an exe from a program using py2exe, cx_freeze and pyinstaller. All of which give me an error 'ImportError: No module named six' when I go to launch the .exe The .exe is able to be created. I've looked through the forums and all of…
Gardener85
  • 369
  • 1
  • 9
1
vote
1 answer

Issues with Six module in Python2.7

The issue began when I was trying to install twilio on my Mac with El Capitan 10.11.6. I got this error: OSError: [Errno 1] Operation not permitted:…
rdacso
  • 11
  • 4
1
vote
1 answer

Django 1.9.13 complains SubfieldBase is deprecated, but I'm not using it. How to resolve?

I am upgrading an old Django project from Django 1.8.3 to the current Django 1.11, but to be cautious, I am upgrading to each major release of Django along the way, so I can find errors & deprecations and fix them before taking the next step. (I…
swizzlevixen
  • 325
  • 1
  • 12
1
vote
1 answer

close the ftp connection after using urlretrieve

from six.moves.urllib.request import urlopen, urlretrieve urlretrieve('ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis.dailyavgs/surface/air.sig995.1949.nc', filename='C:\\desktop\\') Do I need to close the ftp connection after using…
user308827
  • 21,227
  • 87
  • 254
  • 417
1
vote
2 answers

Cannot import Tensorflow in ipython

I have tensorflow version 1.0.0 non-GPU version on my macbook pro Yosemite. It is installed in a virtualenv, and I have python 2.7. I have six version 1.4.1. When I do python on the command line and import six, it works fine. But when I enter…
xiaolingxiao
  • 4,793
  • 5
  • 41
  • 88
1
vote
1 answer

AttributeError : six missing "indexbytes" when compiling protobuf with a custom python plugin

I have an issue when compiling protobuf files with a custom python plugin. On one machine it is running as expected whereas on another one this leads to following error: Traceback (most recent call last): File "C:\...\my_plugin.py", line 14,…
Yohan
  • 113
  • 10
1
vote
1 answer

Wagtail Docker six package conflict on upgrade to wagtail 1.7

We're using docker and docker-compose to run our wagtail site. We've just upgraded to wagtail 1.7 and we're getting an error about the six package conflicting. Error below > Found existing installation: setuptools 3.3 Uninstalling >…
vandekerkoff
  • 415
  • 8
  • 24
1
vote
2 answers

No module named google_auth_httplib2

Goal: Use GAE with Python and Google Cloud Storage to store and serve an image more efficiently to ultimately use the image API. Problem: Cannot find correct modules (httplib2 and six) despite successful install. Run time example Python Code Sample…
1
vote
0 answers

How to keep idiomatic ("" > None) expression from python 2 in python 3?

I have code that relies on python 2 typing feature result1 = result_or_None (...) result2 = result_or_None (...) final = max (result1, result2) Problem is - python 3 doesn't support "Result string" > None comparison so the code returns run-time…
TheNoobGuy
  • 61
  • 3
1
vote
1 answer

Package version difference between pip and OS?

I have Debian OS and python version 2.7 installed on it. But I have a strange issue about package six. I want to use 1.10 version. I have installed six 1.10 via pip: $ pip list ... six (1.10.0) But when I run the following script python -c "import…
Lecko
  • 1,275
  • 1
  • 17
  • 32
1
vote
0 answers

pip keeps installing wrong version of six module

I'm using installing six on MacOS, %> pip install six --user --upgrade Collecting six Using cached six-1.10.0-py2.py3-none-any.whl Installing collected packages: six Successfully installed six-1.4.1 And I confirmed it later with %> python -c…
daisy
  • 22,498
  • 29
  • 129
  • 265
1
vote
1 answer

Webapp2 ImportError: cannot import name _thread

I am trying to start webapp2 development server from terminal but I get this error > File "/Users/mertbarutcuoglu/Desktop/hellowebapp2/main.py", line 12, > in main > from paste import httpserver File…
thekmb
  • 13
  • 1
  • 6
1
vote
3 answers

Missing u-strings on Python 3.2?

I have a litany of unit tests that are run on Travis CI and only on PY3.2 it goes belly up. How can I solve this without using six.u()? def test_parse_utf8(self): s = String("foo", 12, encoding="utf8") self.assertEqual(s.parse(b"hello…
ArekBulski
  • 4,520
  • 4
  • 39
  • 61