Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

Unknown python execution error after running 'blended init' #7

Open
espressobeanies opened this issue Oct 1, 2018 · 4 comments
Open

Comments

@espressobeanies
Copy link

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 espressobeanies changed the title Unknown execution error after running 'blended init' Unknown python execution error after running 'blended init' Oct 1, 2018
@tinglar
Copy link

tinglar commented Dec 16, 2018

I am not the only one!

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

@johnroper100
Copy link
Collaborator

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

@hardyoyo
Copy link

hardyoyo commented Mar 17, 2020

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

@Logof
Copy link

Logof commented May 31, 2020

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"))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants