six

Missing “six” module for astropy after using cx_freeze/py2exe

空扰寡人 提交于 2020-01-15 07:35:30
问题 I was trying to convert program written in python 3 to .exe using cx_freeze and py2exe. But after converting and running program i get the following error: Traceback (most recent call last): File "astroConverter.py", line 8, in <module> File "C:\Users\Konrad\PycharmProjects\astroConverter\mainwindow.py", line 2, in <module> from widgets.widgets import MainMenu, Toolbar, TextField File "C:\Users\Konrad\PycharmProjects\astroConverter\widgets\widgets.py", line 1, in <module> from widgets.menus

Writing cross-compatible Python 2/3: Difference between __future__, six, and future.utils?

落爺英雄遲暮 提交于 2019-12-23 07:41:42
问题 I'm writing cross-compatible Python 2 and 3 code with some help from this cheatsheet. I've noticed there are different packages and modules that help to do this: the future package (e.g. future.utils etc), the six package, and the built in __future__ module. Are there any differences to be aware of when using these packages? Should I be mixing and matching them, or is it possible to write fully cross-compatible code be written with just one of them? 回答1: In terms of python 2-3 compatibility:

Cannot install python six module

烂漫一生 提交于 2019-12-23 05:30:55
问题 I have a server in the AWS cloud. It was running a flask API which calls the Google STT API fine. I then attempted to 'productionise' the API by setting up a virtualenv and getting the API to run there, with the intent of running Gunicorn. When I tried to run the API in the virtual container it gave an error about importing the google api client. There was no google api client folder in my virtualenv so I copied folders across from the main python2.7 site-packages folder. Then I got an error

python 2.7 - Requirement.parse('six>=1.6.0'))

十年热恋 提交于 2019-12-20 06:07:57
问题 Python ... why does this happen? All of a sudden I get this error: Traceback (most recent call last): File "setup.py", line 36, in <module> zip_safe=False) File "/usr/lib/python2.7/distutils/core.py", line 111, in setup _setup_distribution = dist = klass(attrs) File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 320, in __init__ _Distribution.__init__(self, attrs) File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__ self.finalize_options() File "/usr/local/lib

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

限于喜欢 提交于 2019-12-14 02:26:17
问题 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 them say to pip install six (it's already installed). I've tried uninstalling and re-installing six. One post mentioned uninstalling matplotlib, so I did that. When I instlalled pyinstaller one of the requirements was that six be installed! So this

Tensor Flow installation on RHEL 7

喜你入骨 提交于 2019-12-12 18:28:15
问题 I am new to Tensor Flow and trying to install it on my RHEL 7 machine using the below command. I cannot connect the machine directly to internet due to some restrictions so using a whl file downloaded from Tensor flow site. pip install tensorflow-0.5.0-cp27-none-linux_x86_64.whl But getting error as below : Could not find a version that satisfies the requirement six>=1.10.0 (from tensorflow==0.5.0) (from versions: ) No matching distribution found for six>=1.10.0 (from tensorflow==0.5.0) I am

Pip six.add_metaclass error

荒凉一梦 提交于 2019-12-11 16:33:44
问题 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 <module> from pip._internal import main File "/home/c4pta1n/.local/lib/python2.7/site-packages/pip/_internal/__init__.py", line 42, in <module> from pip._internal import cmdoptions File "/home/c4pta1n/.local/lib/python2.7/site-packages/pip/_internal/cmdoptions.py", line 16, in <module> from pip._internal.index import (

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

时间秒杀一切 提交于 2019-12-11 03:13:16
问题 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 python and flask are which python /usr/bin/python which flask /Library/Frameworks/Python.framework/Versions/3.5/bin/flask so I thought of running virtualenv, but l cant even install it with error messages s3transfer 0.1.8 requires botocore<2.0.0,>=1.3.0, which is

Installing Python Module Six

一曲冷凌霜 提交于 2019-12-11 02:39:00
问题 I am running Python 2.7.9 on a Windows 8 machine. I've programmed for a long time (since the 60s), but I'm having trouble figuring out how to install the Six Module. I need a step-by-step set of instructions. Either help here or a suggested website would be helpful to this old man. Thanks! 回答1: On some computers where I don't have pip installed I usually do: Extract the downloaded file In the command line, where you extracted do python setup.py install Module should now be installed You can

How to detect Python Version 2 or 3 in script?

别等时光非礼了梦想. 提交于 2019-12-08 16:23:00
问题 I've written some scripts, which run either only with Version 2.x or some only with Version 3.x of Python. How can I detect inside the script, if it's started with fitting Python Version? Is there a command like: major, minor = getPythonVersion() 回答1: sys.version_info provides the version of the used Python interpreter: >>> import sys >>> sys.version_info sys.version_info(major=2, minor=7, micro=6, releaselevel='final', serial=0) >>> sys.version_info[0] 2 For details see https://docs.python