Blended icon indicating copy to clipboard operation
Blended copied to clipboard

Unknown python execution error after running 'blended init'

Open espressobeanies opened this issue 7 years ago • 4 comments
trafficstars

I receive the following error when attempting to run 'blended init' with no easily identifiable way to resolve the error message:

[root@localhost]# blended init
Traceback (most recent call last):
  File "/bin/blended", line 7, in <module>
    from blended.__main__ import cli
  File "/usr/lib/python3.4/site-packages/blended/__main__.py", line 34, in <module>
    from .functions import create_folder, replace_folder, get_html_filename, get_html_clear_filename, getunzipped, checkConfig, createConfig, createBlendedFolders, parseXML
  File "/usr/lib/python3.4/site-packages/blended/functions.py", line 76
    except IOError, e:
                  ^
SyntaxError: invalid syntax

espressobeanies avatar Oct 01 '18 04:10 espressobeanies

I am not the only one!

I got a workaround. If you installed Blended through Python Pip, you can install the 4.9 version.

tinglar avatar Dec 16 '18 14:12 tinglar

Blended is not supported with the latest version of python. Sorry.

johnroper100 avatar Dec 20 '18 17:12 johnroper100

This would seem to be a documentation issue, then. I suggest adding a description of steps required to install using a current version of Python, and/or specify the versions of Python you do support. Thanks!

As a bit of assistance to whomever might wander across this issue in the future, here are the commands you need to type if you want to use the workaround recommended by tinglar above: pip uninstall blended # uninstall the previously installed blended pip install blended==4.9 # install a version that works with Python 3.7.5

hardyoyo avatar Mar 17 '20 14:03 hardyoyo

functions.py

def getunzipped(username, repo, thedir):
    """Downloads and unzips a zip file"""
    theurl = "https://github.com/" + username + "/" + repo + "/archive/master.zip"
    name = os.path.join(thedir, 'temp.zip')
    try:
        name = urllib.urlretrieve(theurl, name)
        name = os.path.join(thedir, 'temp.zip')
    except IOError as e:
        print("Can't retrieve %r to %r: %s" % (theurl, thedir, e))
        return
    try:
        z = zipfile.ZipFile(name)
    except zipfile.error as e:
        print("Bad zipfile (from %r): %s" % (theurl, e))
        return
    z.extractall(thedir)
    z.close()
    os.remove(name)

    copy_tree(os.path.join(thedir, repo + "-master"), thedir)
    shutil.rmtree(os.path.join(thedir, repo + "-master"))

Logof avatar May 31 '20 20:05 Logof