Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'argument': 0.05; '<>,': 0.07; 'modifying': 0.07; 'nicely': 0.07; 'here?': 0.09; 'throws': 0.09; 'to)': 0.09; 'url:github': 0.09; 'wrong,': 0.09; 'python': 0.11; 'posted': 0.15; '__init__.py': 0.16; 'fine.': 0.16; 'hits': 0.16; 'numpy': 0.16; 'skip:" 100': 0.16; 'str,': 0.16; 'subject:import': 0.16; 'typeerror:': 0.16; 'subject:python': 0.16; 'thanks,': 0.17; 'written': 0.21; 'import': 0.22; 'mike': 0.22; 'to:name:python-list@python.org': 0.22; 'error': 0.23; 'bytes': 0.24; 'instead.': 0.24; 'received:65.55.116': 0.24; "haven't": 0.24; 'looks': 0.24; 'question': 0.24; 'extension': 0.26; 'suggested': 0.26; 'this:': 0.26; "doesn't": 0.30; "i'm": 0.30; 'gives': 0.31; '"",': 0.31; '3.x': 0.31; 'file': 0.32; '(most': 0.33; 'subject:with': 0.35; "can't": 0.35; 'anywhere': 0.35; 'something': 0.35; 'but': 0.35; 'subject:Simple': 0.36; 'url:org': 0.36; 'wrong': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'recent': 0.39; 'skip:. 10': 0.39; 'to:addr:python.org': 0.39; 'skip:n 10': 0.64; 'laptop': 0.65; 'here': 0.66; 'line,': 0.68; 'gotten': 0.74; 'goals': 0.81; 'c-api': 0.84; '\xa0also,': 0.84; 'hands': 0.96 X-TMN: [67Sj9Pelyb6YY+8EMUomWzbOyhZ5Avlq] X-Originating-Email: [moboyle79@outlook.com] From: Mike Boyle To: "python-list@python.org" Subject: Simple import in python 3 errors with complaint about bytes Date: Mon, 20 Oct 2014 23:29:39 +0000 Importance: Normal Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 20 Oct 2014 23:29:39.0427 (UTC) FILETIME=[B7D61B30:01CFECBD] X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413847848 news.xs4all.nl 2895 [2001:888:2000:d::a6]:53139 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79352 I'm modifying an extension written with the c-api to have a datatype of qua= ternions =2C with one of the goa= ls being python 3 support. =A0It works nicely in python 2.7=2C but for pyth= on 3.x gives an error that I can't find anywhere on the google. =A0The dire= ctory looks like this:=0A= =0A= .../site-packages/=0A= =A0 =A0 quaternion/=0A= =A0 =A0 =A0 =A0 __init__.py=0A= =A0 =A0 =A0 =A0 numpy_quaternion.so=0A= =0A= __init__.py contains a line like this:=0A= =0A= =A0 =A0 from .numpy_quaternion import quaternion=0A= =0A= But when it hits that line=2C python 3 throws its hands up in disgust:=0A= =0A= > python -c 'import quaternion'=0A= Traceback (most recent call last):=0A= =A0 File ""=2C line 1=2C in =0A= =A0 File "/Users/mynamehere/.continuum/anaconda/envs/py3k/lib/python3.4/sit= e-packages/quaternion/__init__.py"=2C line 3=2C in =0A= =A0 =A0 from .numpy_quaternion import quaternion=0A= TypeError: __import__() argument 1 must be str=2C not bytes=0A= =0A= The only thing before that line is `import numpy as np`=2C which typically = works just fine. =A0Obviously=2C I'm using python3.4 to compile and (attemp= t to) import (with a conda environment)=2C so it's not something as dumb as= using the wrong python. =A0Also=2C this is the result for both me on my la= ptop and Travis-CI =2C so it = doesn't seem to be anything peculiar to my installation. =A0I've posted thi= s question on stackoverflow=2C but haven't gotten much interest=3B the only= responder suggested I ask here instead.=0A= =0A= Any ideas what's going wrong=2C or where I can go from here?=0A= =0A= Thanks=2C=0A= Mike =