python-3.4

Compiler problems with pip during numpy install under Windows 8.1, 7 Enterprise and 7 Home Editions

喜你入骨 提交于 2019-11-30 06:11:41
I am unable to install numpy via pip install numpy on my computer running Python 3.4 due to various errors I receive linked to compilation issues (This is only the case on a 64-bit installation of Python). This is a problem that has been reported extensively and I had a related question about unable to find vcvarsall.bat. I have tested this on three different clean machines running Windows 8.1, 7 Enterprise and 7 Home Editions and it always comes up. Installing Visual Studio 2010 Express C++ gets rid of the first error in the link - i.e. Unable to find vcvarsall.bat but throws out a next

error: command 'x86_64-linux-gnu-gcc' when installing mysqlclient

若如初见. 提交于 2019-11-30 05:12:17
I installed django 1.8.5 in virtualenv and using python 3.4.3 the worked displayed the it works page when using sqlite I wanted to use mysql and I'm trying to install mysqlclient using pip install mysqlclient and I'm getting the following message ---------------------------------------- Failed building wheel for mysqlclient Failed to build mysqlclient Installing collected packages: mysqlclient Running setup.py install for mysqlclient Complete output from command /home/sasidhar/django/env/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-5lj39q67/mysqlclient/setup.py';exec

How can I overcome this key word error?

随声附和 提交于 2019-11-30 05:07:46
问题 enter code here # -*- coding: utf-8 -*- import math import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import matplotlib.animation as animation fig1=plt.figure() ax=plt.axes(xlim=(-10,10), ylim=(-10,10)) line,=ax.plot([],[],lw=1) """def init (): line.set_data([],[]) return line,""" dt=0.001 X=[] Y=[] r=float(input("Enter the radius :: ")) w=float(input("Enter angular frequency :: ")) def run(data): t=0 while w*t<=2*math.pi: x=r*math.cos(w*t) y=r*math.sin(w*t) X.append(x)

pyaudio installation on mac (python 3)

你说的曾经没有我的故事 提交于 2019-11-30 04:51:23
I first tried: pip install pyaudio but I was told that -bash: pip: command not found Then I tried: pip3 install pyaudio then i got: src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found #include "portaudio.h" ^ 1 error generated. error: command '/usr/bin/clang' failed with exit status 1 ---------------------------------------- Command "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c "import setuptools, tokenize;__file__='/private/var/folders/77/gz1txkwj2z925vk6jrkx3wp80000gn/T/pip-build-43z_qk7o/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)

Install django1.7 with Python 3.4 using virtualenv

孤者浪人 提交于 2019-11-30 03:54:29
I have hit a bit of a brick wall regarding the set up of django 1.7 using a virtualenv configured to Python 3.4. I have created a Python 3.4 virtualenv using: sudo virtualenv --no-site-packages -p /usr/bin/python3.4 venv I have then activated the env using: source venv/bin/activate Once in the activated virtualenv i have tried: sudo pip install https://www.djangoproject.com/download/1.7b1/tarball/ This installs django in the Python 2.7 directory and not in the virtual environment.. Checking with pip freeze shows no installed packages I have tried downloading the zip for django 1.7 and using

Solving install issues with Python 3.4 on Windows

别来无恙 提交于 2019-11-29 22:14:52
I have recently tried to install Python 3.4 as an alternative installation on my system in an attempt to familiarise myself before migrating code. My main Python installation is 2.7.6. I tried the 64 bit installer for Windows, but it came up with an error message There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. After this the install is rolled back (from the point shown below): I have eventually found a solution to this posted below and decided to share in case anyone else

isinstance fails for a type imported via package and from the same module directly

醉酒当歌 提交于 2019-11-29 18:28:49
问题 /Project |-- main.py |--/lib | |--__init__.py | |--foo.py | |--Types.py /Project/lib has been added to the PYTHONPATH variables. Types.py: class Custom(object): def __init__(self): a = 1 b = 2 foo.py: from Types import Custom def foo(o): assert isinstance(o, Custom) Finally, from main.py : from lib.Types import Custom from lib.foo import foo a = Custom() foo(a) The problem now is, that a is of type lib.foo.Custom , while the isinstance call will check if it equals foo.Custom , which obviously

How do I change the overall theme of a tkinter application?

泪湿孤枕 提交于 2019-11-29 15:31:06
I want to change the theme of my tkinter application to clam. What is the code and where do I put it? I have tried: from tkinter import * from tkinter.ttk import * s=ttk.Style() s.theme_use('clam') blakev To change the theme, call .theme_use() with the theme's name as the argument. From https://infohost.nmt.edu/tcc/help/pubs/tkinter/web/ttk-theme-layer.html A number of operations related to themes require that you have available an instance of the ttk.Style() class (in the Python sense of class). For example, to obtain a list of the available themes in your installation: >>> import ttk #

Python resolution of datetime.now()

柔情痞子 提交于 2019-11-29 15:15:45
from datetime import datetime import time for i in range(1000): curr_time = datetime.now() print(curr_time) time.sleep(0.0001) I was testing the resolution of datetime.now() . Since it supposes to output in microsecond, I expected that each print will be different. However, I always get something like that. ... 2015-07-10 22:38:47.212073 2015-07-10 22:38:47.212073 2015-07-10 22:38:47.212073 2015-07-10 22:38:47.212073 2015-07-10 22:38:47.212073 2015-07-10 22:38:47.212073 2015-07-10 22:38:47.212073 2015-07-10 22:38:47.212073 2015-07-10 22:38:47.212073 2015-07-10 22:38:47.212073 2015-07-10 22:38

Why 'python3 -m venv myenv' installs older version of pip into myenv than any version of pip I can find anywhere on the system?

喜你入骨 提交于 2019-11-29 13:39:29
This is not causing me any problem that I can't solve by activating the virtual environment and running pip install -U pip , but I always wonder where the older version of pip is coming from. I'm using OS X 10.7.5. When I create a virtual environment using either pyvenv-3.4 myenv or python3 -m venv myenv , the version of pip that is installed inside the virtual environment is 6.0.8, but I have upgraded my global pip to 6.1.1. Here is a terminal session demonstrating what I mean: $ python3 -m venv myenv $ myenv/bin/pip -V pip 6.0.8 from /Users/dust/Desktop/myenv/lib/python3.4/site-packages