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
2
votes
1 answer

ModuleNotFoundError: No module named 'six' - python 3.8.5

When trying to open jupyter notebook from my terminal in Visual Studio Code, I keep getting the error below. I have tried uninstalling and reinstalling six using conda install but the same issue persists. It was working fine yesterday so I don't…
2
votes
2 answers

python docker throws error: AttributeError: module 'six' has no attribute 'PY34'

I'm writing a script which will build the docker image and then push the image to ECR. my current python version is >python --version Python 3.8.0 so, for some reason, at the first line while running my python at local, I'm getting below error.…
change198
  • 1,647
  • 3
  • 21
  • 60
2
votes
0 answers

Can't import Matplotlib and Pandas

I tried to import matplotlib and pandas, like this (but separately): import matplotlib.pyplot import pandas but each time there was an error. When i imported pandas, it said Traceback (most recent call last): File "", line 1, in…
B. Johnson
  • 45
  • 6
2
votes
4 answers

flask installed, but ModuleNotFoundError: No module named 'Flask'

i have flask installed in my Mac, pip list | grep Flask Flask 1.0.2 but when i execute a python file, it shows error like from Flask import Flask, render_template ModuleNotFoundError: No module named 'Flask' the directories used for…
Yemily Min
  • 37
  • 1
  • 1
  • 2
2
votes
2 answers

Python type() not giving exact class type instead gives metaclass type

I am trying to pass the type of a class to a method so that it can be dynamically instantiated. The class extends to a base class which further extends to an abstract class. Now when I check the type of my class it comes as the abstract class type…
2
votes
1 answer

RKeras "unknown url type: https" error six.urlretrieve (Python Code From R)

TL;DR :-) fetching https urls is working in both python and R, but not when python code is run from R. While running some code in documentation of package RKeras , I have repeatedly run into the fatal error : "unknown url type: https" The problem…
R.S.
  • 2,093
  • 14
  • 29
2
votes
2 answers

PIP Installation doesn't work (six, numpy and python-dateutil requirements)

I'm a quite new to Python and want to install the Pillow package on Mac for Python 3.5. I use the pip install pillowcommand and get this error: Jaspers-MBP:~ jasperherrmann$ pip install pillow Collecting pillow Using cached…
2
votes
1 answer

AttributeError: 'module' object has no attribute 'raise_from' for six library

I got the following error when used taskflow(v2.7.0 and v3.1.0) to launch a flow: 2018-02-10 02:13:15.485 13955 DEBUG taskflow.engines.helpers [-] Looking for 'default' engine driver in 'taskflow.engines' load…
Batter
  • 131
  • 1
  • 7
2
votes
2 answers

Query about using Python - Six module

I'm using the six module in my program, and the code is as follows: if six.PY2: do_something() else: do_something_else() The problem with this approach is that, the function do_something_else() would run only if Python version is 3.4+…
user6577439
2
votes
1 answer

six: cannot import name python_2_unicode_compatible

With six 1.10.0 installed under Python and pip 2.6, an old Django 1.0.4 app is not able to import python_2_unicode_compatible even though it finds six 1.10.0 just fine: >>> import six >>> six.__version__ '1.10.0' >>> from six import…
eduncan911
  • 17,165
  • 13
  • 68
  • 104
2
votes
1 answer

Getting last modified date of file on FTP server using urlopen not working

from six.moves.urllib.request import urlopen, urlretrieve, urlrequest conn = urlopen('ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis.dailyavgs/surface/lftx.sfc.2017.nc', timeout=20) last_modified = conn.headers['last-modified'] Following How can…
user308827
  • 21,227
  • 87
  • 254
  • 417
2
votes
1 answer

travis-ci build on Python3.4 six urllib won't install

I have a go project which has a Python 3.4 dependency (external command). I have a set of requirements called reqs.txt. I use virtualenv to ensure that I'm in my own venv and so I can install my dependencies. I get the following error (full log…
ChrisR
  • 966
  • 14
  • 20
2
votes
3 answers

docker-compose startup error cannot import name _thread

For all the good fellars out there who're trying to get started on docker-compose. I'm running OS X El Capitan (10.11). The system ships with python 2.7. Trying to replace the system python to python 3 isn't recommended because many core systems…
apil.tamang
  • 2,545
  • 7
  • 29
  • 40
2
votes
1 answer

Failture installing PyGreSQL with pip

I am currently trying to install PyGreSQL using pip install PyGreSQL, however, when I run the command I get the following error: Could not import setuptools which is required to install from a source distribution. Traceback (most recent call…
Cesar
  • 115
  • 3
  • 10
2
votes
4 answers

Ubuntu upgrading python packages installed by OS

I'm using Ubuntu 14.04 and PyCharm (the latter is irrelevant I think but...) In my code, an import from the package six does not work and I tried updating (the version in usr/lib/python2.7/ is 1.5.2, while I need 1.10) But I'm getting the…
mttk
  • 890
  • 2
  • 10
  • 11
1 2
3
9 10