Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to process due to 'invalid syntax' #11

Open
boudiccas opened this issue Nov 8, 2015 · 6 comments
Open

Unable to process due to 'invalid syntax' #11

boudiccas opened this issue Nov 8, 2015 · 6 comments

Comments

@boudiccas
Copy link

When trying to run flap on a fully uptodate debian jessie, it consistently fails with this error report -

python -m flap /home/boudiccas/research/herbal/000herbal.tex output
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/flap/__main__.py", line 19, in <module>
    from flap.ui import main
  File "/usr/local/lib/python2.7/dist-packages/flap/ui.py", line 73
    print(message, file=self._output)
                       ^
SyntaxError: invalid syntax

It makes no difference if I try with python3 or sudo python3 or sudo python it just fails with above error report.

@fchauvel
Copy link
Owner

fchauvel commented Nov 9, 2015

Hello,

Thanks for giving flap a try. From the top of my head, I don't have a clue about what may cause that. I will look at this week, and let you know as soon as I find a fix.

@fchauvel
Copy link
Owner

I installed a fresh Debian 8.2 Jessie (Linux 3.16.0-4-amd64) on a virtualbox, but I was not able to reproduce your issue (I installed Python 3.4.2 using Apt). Could you tell what version of FLaP you tried to install and which version of python you are using?

@boudiccas
Copy link
Author

Franck Chauvel [email protected] writes:

I installed a fresh Debian 8.2 Jessie (Linux 3.16.0-4-amd64) on a virtualbox, but I was not able to reproduce your issue (I installed Python 3.4.2 using Apt). Could
you tell what version of FLaP you tried to install and which version of python you are using?

Thanks Franck, my python version is 2.7.9-1 which is the only one
available from the debian repos.

--8<---------------cut here---------------start------------->8---
rmadison python
python | 2.6.6-3+squeeze7 | oldoldstable | all
python | 2.7.3-4+deb7u1 | oldstable | all
python | 2.7.9-1 | stable | amd64, arm64, armel, armhf, i386, mips, mipsel, powerpc, ppc64el, s390x
python | 2.7.9-1 | stable-kfreebsd | kfreebsd-amd64, kfreebsd-i386
python | 2.7.9-1 | testing | amd64, arm64, armel, armhf, i386, mips, mipsel, powerpc, ppc64el, s390x
python | 2.7.9-1 | unstable | amd64, arm64, armel, armhf, hurd-i386, i386, kfreebsd-amd64, kfreebsd-i386, mips, mips64el, mipsel, powerpc, ppc64el, s390x
--8<---------------cut here---------------end--------------->8---

flap =

--8<---------------cut here---------------start------------->8---
/usr/local/lib/python2.7/dist-packages/flap
/usr/local/lib/python2.7/dist-packages/flap/FileSystem.py
/usr/local/lib/python2.7/dist-packages/flap/FileSystem.pyc
/usr/local/lib/python2.7/dist-packages/flap/init.py
/usr/local/lib/python2.7/dist-packages/flap/init.pyc
/usr/local/lib/python2.7/dist-packages/flap/main.py
/usr/local/lib/python2.7/dist-packages/flap/main.pyc
/usr/local/lib/python2.7/dist-packages/flap/engine.py
/usr/local/lib/python2.7/dist-packages/flap/engine.pyc
/usr/local/lib/python2.7/dist-packages/flap/path.py
/usr/local/lib/python2.7/dist-packages/flap/path.pyc
/usr/local/lib/python2.7/dist-packages/flap/ui.py
/usr/local/lib/python2.7/dist-packages/flap/util.py
/usr/local/lib/python2.7/dist-packages/flap/util.pyc
--8<---------------cut here---------------end--------------->8---

Does this help?

Sharon.

A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.0, fluxbox 1.3.7, emacs 24.5.1

@fchauvel
Copy link
Owner

I managed to reproduce the error you have, when I ran FLaP using Python 2.7.9. As FLaP was written for Python 3 in the first place, I suggest to upgrade as a quick fix. Unfortunately, I will not have time to port FLaP to Python 2 in the following months.

By the way, I currently have both Python 2 and 3 on the same Debian Jessie (I used to switch using virtual environments). I installed Python 3 on Jessie from the official repositories (see https://packages.debian.org/jessie/python3-all).

Just let me know if you still face the same issue using Python 3.

@boudiccas
Copy link
Author

Franck Chauvel [email protected] writes:

I managed to reproduce the error you have, when I ran FLaP using Python 2.7.9. As FLaP was written for Python 3 in the first place, I suggest to upgrade as a quick
fix. Unfortunately, I will not have time to port FLaP to Python 2 in the following months.

By the way, I currently have both Python 2 and 3 on the same Debian Jessie (I used to switch using virtual environments). I installed Python 3 on Jessie from the
official repositories (see https://packages.debian.org/jessie/python3-all).

Just let me know if you still face the same issue using Python 3.

Thanks Franck. It turns out that I do have python3 already installed,
but just tend to use whatever the default python is, in this case 2.7!

Anyway I tried to use python3 with flap and it said that flap wasn't
available, so I did some checking, and this is what I found -

--8<---------------cut here---------------start------------->8---
sudo pip install flap
[sudo] password for boudiccas:
Requirement already satisfied (use --upgrade to upgrade): flap in /usr/local/lib/python2.7/dist-packages
Cleaning up...
--8<---------------cut here---------------end--------------->8---

I could maybe uninstall flap -

--8<---------------cut here---------------start------------->8---
sudo pip uninstall flap
Uninstalling FLaP:
/usr/local/lib/python2.7/dist-packages/FLaP-0.3.0.egg-info
/usr/local/lib/python2.7/dist-packages/flap/FileSystem.py
/usr/local/lib/python2.7/dist-packages/flap/FileSystem.pyc
/usr/local/lib/python2.7/dist-packages/flap/init.py
/usr/local/lib/python2.7/dist-packages/flap/init.pyc
/usr/local/lib/python2.7/dist-packages/flap/main.py
/usr/local/lib/python2.7/dist-packages/flap/main.pyc
/usr/local/lib/python2.7/dist-packages/flap/engine.py
/usr/local/lib/python2.7/dist-packages/flap/engine.pyc
/usr/local/lib/python2.7/dist-packages/flap/path.py
/usr/local/lib/python2.7/dist-packages/flap/path.pyc
/usr/local/lib/python2.7/dist-packages/flap/ui.py
/usr/local/lib/python2.7/dist-packages/flap/util.py
/usr/local/lib/python2.7/dist-packages/flap/util.pyc
/usr/local/lib/python2.7/dist-packages/tests/init.py
/usr/local/lib/python2.7/dist-packages/tests/init.pyc
/usr/local/lib/python2.7/dist-packages/tests/acceptance.py
/usr/local/lib/python2.7/dist-packages/tests/acceptance.pyc
/usr/local/lib/python2.7/dist-packages/tests/commons.py
/usr/local/lib/python2.7/dist-packages/tests/commons.pyc
/usr/local/lib/python2.7/dist-packages/tests/sandbox.py
/usr/local/lib/python2.7/dist-packages/tests/sandbox.pyc
/usr/local/lib/python2.7/dist-packages/tests/unit/init.py
/usr/local/lib/python2.7/dist-packages/tests/unit/init.pyc
/usr/local/lib/python2.7/dist-packages/tests/unit/engine.py
/usr/local/lib/python2.7/dist-packages/tests/unit/engine.pyc
/usr/local/lib/python2.7/dist-packages/tests/unit/fileSystem.py
/usr/local/lib/python2.7/dist-packages/tests/unit/fileSystem.pyc
/usr/local/lib/python2.7/dist-packages/tests/unit/path.py
/usr/local/lib/python2.7/dist-packages/tests/unit/path.pyc
/usr/local/lib/python2.7/dist-packages/tests/unit/ui.py
/usr/local/lib/python2.7/dist-packages/tests/unit/ui.pyc
/usr/local/lib/python2.7/dist-packages/tests/unit/util.py
/usr/local/lib/python2.7/dist-packages/tests/unit/util.pyc
Proceed (y/n)? n
--8<---------------cut here---------------end--------------->8---

but then, how do I install it just for python3? If I manually remove it
From python2.7 and place it in python3, surely that would break
something?

Any ideas please?

Thanks

Sharon.

A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.0, fluxbox 1.3.7, emacs 24.5.1

@fchauvel
Copy link
Owner

I'm using virtualenv. It creates local installations of python, where one can install packages without installing them for all other projects or users. From memory, the sequence of commands to use is something like:

$> pip install virtualenv
$> cd my/project/folder
$> virtualenv --python=python3 env3
$> source env3/bin/activate
$> pip install flap

The third command creates the env3directory, which contains an installation (probably some links) to Python 3 (which must be already available on your system). The fourth command activates this brand new Python environment, and finally we install flap only in this environment. I personally find virtualenv pretty handy when working simultaneously on projects that require different or incompatible settings.

Hope this helps.

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

No branches or pull requests

2 participants