pywavefront / PyWavefront

Python library for importing Wavefront .obj files
BSD 3-Clause "New" or "Revised" License
306 stars 79 forks source link

this syntax is not supported by python 2.7 #96

Closed seandepagnier closed 5 years ago

seandepagnier commented 5 years ago

Using yield from is not supported by python 2.7. Is it really needed?

https://github.com/pywavefront/PyWavefront/blob/39ee5186cb37750d4654d19ebe43f723ecd01e2f/pywavefront/obj.py#L403

einarf commented 5 years ago

Use the python2 branch : https://github.com/pywavefront/PyWavefront/tree/python2 or pip install the latest 0.x release.

Current setup.py in master has python version requirements. https://github.com/pywavefront/PyWavefront/blob/39ee5186cb37750d4654d19ebe43f723ecd01e2f/setup.py#L31

pywavefront releases on PyPI: https://pypi.org/project/PyWavefront/#history (1.x versions only have py3 wheels)

Generators will be even more used in 2.x so we decided to require py 3.4 for the 1.x releases. It's really important for performance because it reduces memory allocations a lot. When you start dealing with very large obj files you are faced with this reality fairly quicky were python can spend more than 5 minutes parsing a file compared to a few seconds in C/C++.

seandepagnier commented 5 years ago

sure, I have installed a 0.x version with success.

Right now "pip install pywavefront" installs a version which does not work. Can this be fixed for the future?

On 4/7/19, Einar Forselv notifications@github.com wrote:

Use the python2 branch : https://github.com/pywavefront/PyWavefront/tree/python2 or pip install the latest 0.x release.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/pywavefront/PyWavefront/issues/96#issuecomment-480604157

einarf commented 5 years ago

Using python 2.7.15:

$ pip install pywavefront
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pywavefront
  Downloading https://files.pythonhosted.org/packages/f0/a3/6ca004f861af7775dd666ea1fc537a1ce90f2ae5afeac5525eb7e43a29d9/PyWavefront-0.4.2-py2.py3-none-any.whl
Installing collected packages: pywavefront
Successfully installed pywavefront-0.4.2

As you can see pip should only install the latest 0.x version using python 2. I even extracted the whl file to check that this version do not contain yield from.

I might be missing something here or you have a very strange python setup. Can you share the exact output when installing the package including pip freeze and python --version? If there is something wrong here I will get it fixed at once.

seandepagnier commented 5 years ago

pi@openplotter:~$ python --version Python 2.7.13 pi@openplotter:~$ pip freeze automationhat==0.1.0 beautifulsoup4==4.5.3 blinker==1.3 blinkt==0.1.2 buttonshim==0.0.2 Cap1xxx==0.1.3 certifi==2019.3.9 chardet==3.0.4 Cheetah==2.4.4 Click==7.0 colorama==0.3.7 colorzero==1.1 cryptography==1.7.1 cycler==0.10.0 decorator==4.0.11 drumhat==0.1.0 enum34==1.1.6 envirophat==1.0.0 ExplorerHAT==0.4.2 Flask==1.0.2 Flask-SocketIO==3.3.2 fourletterphat==0.1.0 functools32==3.2.3.post2 future==0.17.1 geomag==0.9.2015 gevent==1.1.2 gevent-websocket==0.9.3 gpiozero==1.5.0 gps==3.16 greenlet==0.4.11 html5lib==0.999999999 idna==2.8 iniparse==0.4 ipaddress==1.0.17 itsdangerous==1.1.0 Jinja2==2.10 keyring==10.1 keyrings.alt==1.3 lxml==3.7.1 MarkupSafe==1.1.1 matplotlib==2.0.0 microdotphat==0.2.1 mote==0.0.4 motephat==0.0.2 networkx==1.11 numpy==1.12.1 oauthlib==3.0.1 paho-mqtt==1.4.0 pantilthat==0.0.7 phatbeat==0.1.1 pianohat==0.1.0 picamera==1.13 picraft==1.0 piglow==1.2.4 pigpio==1.38 Pillow==4.0.0 pyasn1==0.1.9 pycrypto==2.6.1 pyglet==1.3.2 pygobject==3.22.0 pygraphviz==1.4rc1 pyinotify==0.9.6 PyJWT==1.4.2 PyMata==2.18 pynmea2==1.15.0 PyOpenGL==3.1.0 pyOpenSSL==16.2.0 pyparsing==2.1.10 pypilot==0.2 pyrtlsdr==0.2.91 pyserial==3.4 python-dateutil==2.5.3 python-engineio==3.5.0 python-gammu==2.7 python-socketio==3.1.2 pytz==2016.7 pyudev==0.21.0 pyxdg==0.25 PyYAML==3.12 pyzmq==16.0.2 rainbowhat==0.1.0 requests==2.21.0 requests-oauthlib==1.2.0 RPi.GPIO==0.6.5 RTIMULib==8.0.0 scipy==0.18.1 scrollphat==0.0.7 scrollphathd==1.2.1 SecretStorage==2.3.1 simplejson==3.10.0 six==1.12.0 skywriter==0.0.7 sn3218==1.2.7 spidev==3.4 subprocess32==3.2.7 touchphat==0.0.1 twython==3.7.0 ujson==1.35 unicornhathd==0.0.4 urllib3==1.24.1 w1thermsensor==1.0.5 webencodings==0.5 websocket-client==0.55.0 Werkzeug==0.14.1 wxPython==3.0.2.0 wxPython-common==3.0.2.0 pi@openplotter:~$ sudo pip install pywavefront Collecting pywavefront Using cached https://www.piwheels.org/simple/pywavefront/PyWavefront-1.0.0-py2.py3-none-any.whl Installing collected packages: pywavefront Successfully installed pywavefront-1.0.0

On 4/7/19, Einar Forselv notifications@github.com wrote:

Using python 2.7.15:

$ pip install pywavefront
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020.
Please upgrade your Python as Python 2.7 won't be maintained after that
date. A future version of pip will drop support for Python 2.7.
Collecting pywavefront
  Downloading
https://files.pythonhosted.org/packages/f0/a3/6ca004f861af7775dd666ea1fc537a1ce90f2ae5afeac5525eb7e43a29d9/PyWavefront-0.4.2-py2.py3-none-any.whl
Installing collected packages: pywavefront
Successfully installed pywavefront-0.4.2

As you can see pip should only install the latest 0.x version using python

  1. I even extracted the whl file to check that this version do not contain yield from.

I might be missing something here or you have a very strange python setup. Can you share the exact output when installing the package including pip freeze and python --version? If there is something wrong here I will get it fixed at once.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/pywavefront/PyWavefront/issues/96#issuecomment-480645418

seandepagnier commented 5 years ago

After pip install:

pi@openplotter:~$ pip freeze | grep -i wave PyWavefront==1.0.0

einarf commented 5 years ago

I see the wheel URL is https://www.piwheels.org/ so I guess this is a specific problem with that index and/or you need to upgrade pip: pip install -U pip (possibly also setuptools)

If that doesn't solve the problem just pip install pywavefront==0.4.2.

Pywavefront==1.0.0 is not listed as a valid release in PyPI. It was uploaded

einarf commented 5 years ago

I made an issue in the piwheels project: bennuttall/piwheels/issues/142

1.0.0 is not a version the PyPI index expose as a valid version for pywavefront. It does exist, but was de-listed because the package was incorrectly built.

einarf commented 5 years ago

Resolved in piwheels 🍰