python-3.7

Installing Python3.6 alongside Python3.7 on Mac

偶尔善良 提交于 2019-12-04 07:25:47
问题 I'm trying to install tensorflow onto a Mac with Python3.7. However, I'm getting the error: $ pip3 -v install tensorflow ... Skipping link https://files.pythonhosted.org/packages/56/7a/c6bca0fe52a94ca508731d8b139e7dbd5a36cddc64c19f422f97e5a853e8/tensorflow-1.10.0rc1-cp36-cp36m-win_amd64.whl#sha256=3ab24374888d6a13d55ce2e3cf4ba0c9cd6f824723313db5322512087525cb78 (from https://pypi.org/simple/tensorflow/); it is not compatible with this Python Could not find a version that satisfies the

ipython3 does not work in the terminal with python3.7

眉间皱痕 提交于 2019-12-04 03:11:17
问题 I recently upgraded from Python3.6 to Python3.7. Since I have upgraded, when I type in ipython3 in the terminal I get an error: ~$ ipython3 Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 48, in <module> from .core.application import Application File "/usr/lib/python3/dist-packages/IPython/core/application.py", line 25, in <module> from IPython.core import release, crashhandler File "/usr/lib/python3/dist

PyQt5 Horizontal Scrollbar in QTableWidget not appearing

亡梦爱人 提交于 2019-12-02 23:02:49
问题 I have a QTableWidget displaying times for each bus stop from a database, however for some reason in the table, the horizontal scrollbar doesn't appear. I can only scroll by dragging off the table I have already tried setting its policy to always on but it doesn't seem to work # Route search table display settings self.route_search_table = QtWidgets.QTableWidget(self.route_search_frame) self.route_search_table.setGeometry(QtCore.QRect(20, 180, 371, 251)) self.route_search_table.setStyleSheet(

Installing Python3.6 alongside Python3.7 on Mac

六眼飞鱼酱① 提交于 2019-12-02 15:42:49
I'm trying to install tensorflow onto a Mac with Python3.7. However, I'm getting the error: $ pip3 -v install tensorflow ... Skipping link https://files.pythonhosted.org/packages/56/7a/c6bca0fe52a94ca508731d8b139e7dbd5a36cddc64c19f422f97e5a853e8/tensorflow-1.10.0rc1-cp36-cp36m-win_amd64.whl#sha256=3ab24374888d6a13d55ce2e3cf4ba0c9cd6f824723313db5322512087525cb78 (from https://pypi.org/simple/tensorflow/); it is not compatible with this Python Could not find a version that satisfies the requirement tensorflow (from versions: ) Cleaning up... Removed build tracker '/private/var/folders/4n

PyQt5 Horizontal Scrollbar in QTableWidget not appearing

别来无恙 提交于 2019-12-02 10:13:25
I have a QTableWidget displaying times for each bus stop from a database, however for some reason in the table, the horizontal scrollbar doesn't appear. I can only scroll by dragging off the table I have already tried setting its policy to always on but it doesn't seem to work # Route search table display settings self.route_search_table = QtWidgets.QTableWidget(self.route_search_frame) self.route_search_table.setGeometry(QtCore.QRect(20, 180, 371, 251)) self.route_search_table.setStyleSheet("background-color: rgb(255, 255, 255)") self.route_search_table.setObjectName("route_search_table")

Python - Variable in function not defined

跟風遠走 提交于 2019-12-02 09:54:04
问题 I'm trying to simulate a lottery and have a little problem with my functions. Here's what I'm trying to do: run window1() window1() --> destroy_window1() --> window2() window2() --> destroy window2 or retry() --> window1() The error occurs when I reach destroy_window1(), where i get the following message: "NameError: name 'e1' is not defined". How can I solve this problem? I've read that you should pre-define the variables outside the functions. So, I tried to just put e1 = 1 etc., but then i

Can't install pyHook package “Could not find a version that satisfies the requirement pyHook”

那年仲夏 提交于 2019-12-02 08:03:52
im trying to install the pyHook package in pycharm but get the error in the title. I have successfully installed it in cmd with pip install pyHook-1.5.1-cp37-cp37m-win_amd64.whl ,but when I go to install it in pycharm I get the aforementioned error : Collecting pyHook Could not find a version that satisfies the requirement pyHook (from versions: ) No matching distribution found for pyHook I ran into this problem myself, and after alot of searching, found that although pyhook has wheels for python 3, it's incompatible. Look at the last release date for pyhook: October 10th 2008. Python 3 was

Python - Variable in function not defined

寵の児 提交于 2019-12-02 04:33:38
I'm trying to simulate a lottery and have a little problem with my functions. Here's what I'm trying to do: run window1() window1() --> destroy_window1() --> window2() window2() --> destroy window2 or retry() --> window1() The error occurs when I reach destroy_window1(), where i get the following message: "NameError: name 'e1' is not defined". How can I solve this problem? I've read that you should pre-define the variables outside the functions. So, I tried to just put e1 = 1 etc., but then i get the message: "AttributeError: 'int' object has no attribute 'get'". Since it's an entry, I don't

Tkinter - Image won't show up on button despite keeping global reference

别等时光非礼了梦想. 提交于 2019-12-01 22:44:57
I want to place a button in the upper right corner and have the button be an image. I understand about scoping/garbage-collection etc. and have seen all the other questions asked here that overlook this fact. However, I have tried numerous methods including creating a self.photo and declaring photo as a global variable. I'm actually not even convinced that that's the issue, because I declare the photo in the same scope as I call the mainloop() . My code right now (which is mostly borrowed from Drag window when using overrideredirect since I'm not really familiar with tkinter): import tkinter

Retrieving python 3.6 handling of re.sub() with zero length matches in python 3.7

痞子三分冷 提交于 2019-12-01 17:54:09
handling of zero length matches has changed with python 3.7. Consider the following with python 3.6 (and previous): >>> import re >>> print(re.sub('a*', 'x', 'bac')) xbxcx >>> print(re.sub('.*', 'x', 'bac')) x We get the following with python 3.7: >>> import re >>> print(re.sub('a*', 'x', 'bac')) xbxxcx >>> print(re.sub('.*', 'x', 'bac')) xx I understand this is the standard behavior of PCRE. Furthermore, re.finditer() seems to have always detected the additional match: >>> for m in re.finditer('a*', 'bac'): ... print(m.start(0), m.end(0), m.group(0)) ... 0 0 1 2 a 2 2 3 3 That said, I'm