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
0
votes
0 answers

py2 and py3 compatible code to replace extended unpacking (*args) in function

I have some python3 code that I'm trying to make compatible with python2. This has mostly been easy using the six package and __future__, but I can't find a way around 'extended unpacking' (i.e. using the *args syntax). For example, the…
DilithiumMatrix
  • 17,795
  • 22
  • 77
  • 119
0
votes
3 answers

six cannot be imported/uninstalled/reinstalled/upgraded

I'm trying to run lldb on my MacBook terminal, but I get errors related to the six package: File "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 98, in import six ImportError:…
benams
  • 4,308
  • 9
  • 32
  • 74
0
votes
2 answers

Install Tensorflow in virtual environment python 2.7

Please, how can i install Tensorflow in a virtual environment? I have used these commands but it doesn't work.. sudo -H pip3 install tensorflow --proxy https://XXX.XX.XX.X:3128 sudo -E pip3 install tensorflow --proxy…
user1543915
  • 1,025
  • 1
  • 10
  • 16
0
votes
2 answers

Pip six.add_metaclass error

A few days ago I started getting the following error when using pip (1,2 or 3) to install. * Traceback (most recent call last): File "/home/c4pta1n/.local/bin/pip", line 7, in from pip._internal import main File…
Greg K
  • 7
  • 5
0
votes
1 answer

Installing error with six dependency

Running setup.py install for anyjson ... done Found existing installation: six 1.4.1 DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that…
R11G
  • 1,941
  • 8
  • 26
  • 37
0
votes
2 answers

Linux Python Scrapy No module named six.moves

We want to use scrapy in linux machine. We use python 2.7 version and install scrapy 1.4.0 (pip install scrapy). We add import scrapy to .py file. When we run .py file, give error like below: File "mapper.py", line 5, in     import…
slnkykrn
  • 71
  • 9
0
votes
0 answers

Scipy and six downgraded automatically after installing Keras

After I installed keras, it downgraded my six and scipy. I also found out that many other libraries are downgraded also. Is this normal?
saga
  • 736
  • 2
  • 8
  • 20
0
votes
1 answer

Six's socket implementation

I build an app compatible between Python 2 and 3. In order to provide compatibility between those two Python versions, I use six library. My code uses sockets. Under Python 3 it is possible to create them using with statement, but under Python 2 it…
pt12lol
  • 2,332
  • 1
  • 22
  • 48
0
votes
1 answer

python six library for 2 and 3 compatibility for requests

How can I use the python six library for 2 and 3 compatibility on the foll. code sample: import urllib.request wp = urllib.request.urlopen("http://google.com") pw = wp.read() print(pw) -- EDIT I tried this: from six.moves.urllib.request import…
user308827
  • 21,227
  • 87
  • 254
  • 417
0
votes
0 answers

How to convert command line switch to unicode Python2 and 3 compatible

I'm trying to make Argparse using unicode in both PY2 and PY3 preferably without complex constructs like if six.PY2: or sys.version_info.major. When it comes to using unicode for io operations or immediate string literals I know I have to use…
Alex
  • 252
  • 1
  • 6
  • 18
0
votes
1 answer

List of logging levels compatibility between Python 2 and Python 3

To have a list of logging levels in Python 2 I have to call this: logging._levelNames.keys() While Python 3 logging module has this: list(logging._nameToLevel) I am just adding six to my project to provide compatibility between Python 2 and Python…
pt12lol
  • 2,332
  • 1
  • 22
  • 48
0
votes
1 answer

Google App Engine Flask Sample ERROR: "no module named six"

after installing the gcloud SDK and cloning the samples git rep to my local machine, I opened the Flask / hello_world sample and did pip install -t lib -r requirements.txt. I am using virtualenv. Then I got the following error: File…
NightOwl
  • 1,069
  • 3
  • 13
  • 23
0
votes
1 answer

Import error when deploying django app to Heroku

I am trying to deploy the app that they have mentioned in the getting started section. However I am getting error ModuleNotFoundError: No module named 'six'. The whole build log is mentioned below: -----> Python app detected -----> Installing…
Suyash Mittal
  • 73
  • 1
  • 13
0
votes
3 answers

Heroku build fails always - Says no module named six

Counting objects: 1260, done. Delta compression using up to 4 threads. Compressing objects: 100% (1208/1208), done. Writing objects: 100% (1260/1260), 6.24 MiB | 184.00 KiB/s, done. Total 1260 (delta 109), reused 0 (delta 0) remote: Compressing…
0
votes
1 answer

Not able to use nsetools on Mac OS X 10.11.9

I am not able to use nsetools on Mac OS X 10.11.6. sudo pip install nsetools Password: The directory '/Users/debraj/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the…
tuk
  • 5,941
  • 14
  • 79
  • 162