-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
SyntaxError: invalid syntax #1753
Comments
Ugly hack-around is to modify that line to only raise the exception: #raise exception_type, self._exception, self._traceback
raise self._exception |
Same issue on osx with v11.8.0, but on python 3.6.2. Also the same error I got when I made issue #1589 last week. @pglombardo's fix works if you just need to get moving. EDIT: see below for actual fix. |
FWIW, I'm getting this same error when I deploy my python application to Heroku. Update: I was able to get Heroku builds working again by changing my |
The issue seems to arise from having You can tell if you have the problem if you see that the exception is being thrown from
The fix is to uninstall the package:
Verifying that importing
No more issues with pipenv after this. |
@damouse Making sure before I close this: so this is a setup problem, correct? Pipenv does not install |
@uranusjr yeah I think you're clear, its not |
Add the parent site-packages directory to sys.path *after* built-in ones, and only when it does not already exist. This should vastly improve the resolver's robustness against hostile Python environments, such as pypa#1753. It might help with issues like pypa#693 as well, but I'm not sure (and not interested in figuring out either).
I was seeing this issue on Heroku too, and had to clear the slug build cache to solve it:
(I agree this should be closed, just leaving this here for other people who encounter this problem and find this issue while searching for a resolution.) |
Add the parent site-packages directory to sys.path *after* built-in ones, and only when it does not already exist. This should vastly improve the resolver's robustness against hostile Python environments, such as pypa#1753. It might help with issues like pypa#693 as well, but I'm not sure (and not interested in figuring out either).
@KeynesYouDigIt You might want to make sure you’re running a recent version of Pipenv though. I believe the situation has been greately improved in 11.8.3. You might not need to uninstall futures if the changes work for you. |
Thanks @uranusjr - A full upgrade of pip and pipenv got it moving |
As stated ^ I encountered this issue with pipenv, version 2018.11.26 and latest pip. Uninstalling futures fixed it but it would be better to find a way to avoid it. |
The easiest “fix” is to convince maintainers of |
@uranusjr I think is not as easy as it appears because effectively futures project says that it supposed to be used only on py2. Check https://pypi.org/project/futures/3.3.0/#files -- But the 3.1.1 release is the last one that does not mention this on its wheel. This means that any project that lists I am sure that futures will say is not their problem. I wonder how can I find who is installing futures on py3.... |
This thread should give more insights agronholm/pythonfutures#83 |
Yeah I was afraid that would be the case as well. While I sympathise the technical argument (it really is not their fault), at some point package maintainers need to realise when downstream dependants mess things up you still take the “blame”, and it makes things easier to be practical in certain situations. But I digress. Pipenv could do better to prevent a rogue package from breaking the world as well, but unfortunately it is quite a degree more difficult to implement, and we lack the resources to do it (especially when it is obvious how much less resource it’d take to fix it elsewhere). The problem is as structural (to OSS) as technical. |
When running
pipenv
I'm getting a syntax error.python -m pipenv.help
also results in a Syntax error.This might be due to pipenv although I'm not completely convinced. Any direction, hints or ideas would be appreciated
Python 3.5.2 (via pyenv)
pip 9.0.1 from /Users/pglombardo/.pyenv/versions/3.5.2/lib/python3.5/site-packages (python 3.5)
pipenv (11.8.0) installed via pip
MacOS Sierra
Expected result
No syntax errors
Actual result
Stacktrace output:
Steps to replicate
run any command with pipenv
The text was updated successfully, but these errors were encountered: