Skip to content

SyntaxError message appear in the case of python3 environment pip. #254

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

Closed
yoshiya0503 opened this issue Jun 12, 2015 · 4 comments
Closed

Comments

@yoshiya0503
Copy link
Contributor

[issue]
I think 'Invoke' is best choice for running tasks, but there are some week points about vendor.
For example, we install 'invoke' by 'pip3' in the case of using python3 virtual environment created by 'pyvenv' or 'virtualenv', SyntaxError message will appear.
In spite of the a�bove message, Install has success.(however it looks misshapen...)

[cause]
AFAIK, the cause of the above issue is that both 'yaml2' and 'yaml3' in 'vendor' are installed.
Hopefully, managing 3rd party package should be replace more better method.
(using 'install_requires' of setuptools)
However�, it is not so easy to replace and test.
Then, first of all, either yaml2 or yaml3 should be required depending on the situation(python3 or python2).
This change will be very small and easy.

[pip install log]
Downloading/unpacking invoke
Downloading invoke-0.10.1-py2.py3-none-any.whl (166kB): 166kB downloaded
Installing collected packages: invoke
*** Error compiling '/private/tmp/pip_build_root/invoke/invoke/vendor/yaml2/constructor.py'...
File "/private/tmp/pip_build_root/invoke/invoke/vendor/yaml2/constructor.py", line 130
except TypeError, exc:
^
SyntaxError: invalid syntax

*** Error compiling '/private/tmp/pip_build_root/invoke/invoke/vendor/yaml2/reader.py'...
File "/private/tmp/pip_build_root/invoke/invoke/vendor/yaml2/reader.py", line 158
except UnicodeDecodeError, exc:
^
SyntaxError: invalid syntax

*** Error compiling '/private/tmp/pip_build_root/invoke/invoke/vendor/yaml2/resolver.py'...
File "/private/tmp/pip_build_root/invoke/invoke/vendor/yaml2/resolver.py", line 171
re.compile(ur'''^(?:yes|Yes|YES|no|No|NO
|true|True|TRUE|false|False|FALSE
|on|On|ON|off|Off|OFF)$''', re.X),

                                         ^

SyntaxError: invalid syntax

*** Error compiling '/private/tmp/pip_build_root/invoke/invoke/vendor/yaml2/scanner.py'...
File "/private/tmp/pip_build_root/invoke/invoke/vendor/yaml2/scanner.py", line 1427
except UnicodeDecodeError, exc:
^
SyntaxError: invalid syntax

Successfully installed invoke
Cleaning up...

[Related matters]
#4
#204

@bitprophet
Copy link
Member

Let's just merge this with the PR so there's only one to track.

@matheo
Copy link

matheo commented Oct 13, 2015

I'm getting this yaml2 error messages right now with 0.11.1
on ubuntu 14.04 LTS with:
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)
Python 3.4.3
this wasn't fixed?

$ apt-get install -y python3-setuptools python3-pip
$ pip3 install invoke

Downloading/unpacking invoke
  Downloading invoke-0.11.1-py2.py3-none-any.whl (148kB): 148kB downloaded
Installing collected packages: invoke
*** Error compiling '/tmp/pip_build_root/invoke/invoke/vendor/yaml2/constructor.py'...
  File "/tmp/pip_build_root/invoke/invoke/vendor/yaml2/constructor.py", line 130
    except TypeError, exc:
                    ^
SyntaxError: invalid syntax

*** Error compiling '/tmp/pip_build_root/invoke/invoke/vendor/yaml2/reader.py'...
  File "/tmp/pip_build_root/invoke/invoke/vendor/yaml2/reader.py", line 158
    except UnicodeDecodeError, exc:
                             ^
SyntaxError: invalid syntax

*** Error compiling '/tmp/pip_build_root/invoke/invoke/vendor/yaml2/resolver.py'...
  File "/tmp/pip_build_root/invoke/invoke/vendor/yaml2/resolver.py", line 171
    re.compile(ur'''^(?:yes|Yes|YES|no|No|NO
                    |true|True|TRUE|false|False|FALSE
                    |on|On|ON|off|Off|OFF)$''', re.X),


                                             ^
SyntaxError: invalid syntax

*** Error compiling '/tmp/pip_build_root/invoke/invoke/vendor/yaml2/scanner.py'...
  File "/tmp/pip_build_root/invoke/invoke/vendor/yaml2/scanner.py", line 1427
    except UnicodeDecodeError, exc:
                             ^
SyntaxError: invalid syntax

Successfully installed invoke
Cleaning up...

@danryu
Copy link

danryu commented Feb 16, 2016

I'm still getting this error, when trying to install latest invoke with pip3 on Ubuntu Trusty LTS.

root@vagrant-ubuntu-trusty-64:~# pip3 install invoke
Downloading/unpacking invoke
  Downloading invoke-0.12.2-py2.py3-none-any.whl (166kB): 166kB downloaded
Installing collected packages: invoke
*** Error compiling '/tmp/pip_build_root/invoke/invoke/vendor/yaml2/constructor.py'...
  File "/tmp/pip_build_root/invoke/invoke/vendor/yaml2/constructor.py", line 130
    except TypeError, exc:
                    ^
SyntaxError: invalid syntax

*** Error compiling '/tmp/pip_build_root/invoke/invoke/vendor/yaml2/reader.py'...
  File "/tmp/pip_build_root/invoke/invoke/vendor/yaml2/reader.py", line 158
    except UnicodeDecodeError, exc:
                             ^
SyntaxError: invalid syntax

*** Error compiling '/tmp/pip_build_root/invoke/invoke/vendor/yaml2/resolver.py'...
  File "/tmp/pip_build_root/invoke/invoke/vendor/yaml2/resolver.py", line 171
    re.compile(ur'''^(?:yes|Yes|YES|no|No|NO
                    |true|True|TRUE|false|False|FALSE
                    |on|On|ON|off|Off|OFF)$''', re.X),


                                             ^
SyntaxError: invalid syntax

*** Error compiling '/tmp/pip_build_root/invoke/invoke/vendor/yaml2/scanner.py'...
  File "/tmp/pip_build_root/invoke/invoke/vendor/yaml2/scanner.py", line 1427
    except UnicodeDecodeError, exc:
                             ^
SyntaxError: invalid syntax

Successfully installed invoke
Cleaning up...

@bitprophet
Copy link
Member

@danryu see #319 for the continuing discussion about this. upshot is 0.12.3 will be released with separate py2/py3 wheels each with the appropriate interpreter-specific pyyaml.

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

4 participants