Trying to install terraform_utils with pip on python 2.7 on Mac.
ERROR: Command errored out with exit status 1:
command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-p0O4_9/terraform-utils/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-p0O4_9/terraform-utils/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-30t_an
cwd: /private/tmp/pip-install-p0O4_9/terraform-utils/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-p0O4_9/terraform-utils/setup.py", line 8
def read_file(path: Union[str, Path]) -> str:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
can anyone help with the above error? not able to figure out what's missing!
Looks like you are running this code with Python2.7 but it is supported only by Python 3.5+. This syntax refers to static typing, more information here:
https://docs.python.org/3/library/typing.html
Related
I want to install the pywhatkit package, but I got an error like this:
ERROR: Command errored out with exit status 1:
command: /data/data/com.termux/files/usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-JBqkiU/pywhatkit/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-JBqkiU/pywhatkit/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-d8Zuw6
cwd: /data/data/com.termux/files/usr/tmp/pip-install-JBqkiU/pywhatkit/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/data/data/com.termux/files/usr/tmp/pip-install-JBqkiU/pywhatkit/setup.py", line 6
def readme() -> str:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
You are using python version 2 /data/data/com.termux/files/usr/bin/python2
I'm trying to install tensorflow-recommenders using pip but I keep getting this error.
I made sure I had Tensorflow 2.x installed and upgraded, but I keep getting the same error after running this command:
pip install tensorflow-recommenders
Error:
command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-install-94eA0b/tensorflow-recommenders/setup.py'"'"'; __file__='"'"'/private/var/folders/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-install-94eA0b/tensorflow-recommenders/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-pip-egg-info-n6vhs1
cwd: /private/var/folders/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-install-94eA0b/tensorflow-recommenders/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-install-94eA0b/tensorflow-recommenders/setup.py", line 17, in <module>
import pathlib
ImportError: No module named pathlib
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried everything I could, so if anyone has any suggestions it'd be super helpful!
I was trying to use TTFQuery module but when i write the command pip3 install TTFQuery it returns the following error.
ERROR: Command errored out with exit status 1:
command: 'c:\users\pranon rahman\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\PRANON~1\\AppData\\Local\\Temp\\pip-install-z2hpgfba\\TTFQuery\\setup.py'"'"'; __file__='"'"'C:\\Users\\PRANON~1\\AppData\\Local\\Temp\\pip-install-z2hpgfba\\TTFQuery\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);
code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\PRANON~1\AppData\Local\Temp\pip-pip-egg-info-2u2rs2sz'
cwd: C:\Users\PRANON~1\AppData\Local\Temp\pip-install-z2hpgfba\TTFQuery\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\PRANON~1\AppData\Local\Temp\pip-install-z2hpgfba\TTFQuery\setup.py", line 11
except ImportError, err:
^
SyntaxError: invalid syntax
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
TTFQuery 1.0.5, last released in 2012. The code is obviously only for Python 2.
There is a beta release 2.0.0b1 from 2018. Try
pip install TTFQuery==2.0.0b1
When I try to execute the following command:
pip install jinja
I have the following error:
Collecting Jinja
Using cached Jinja-1.2.tar.gz (252 kB)
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files\Python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\siddh\\AppData\\Local\\Temp\\pycharm-packaging\\Jinja\\setup.py'"'"'; __file__='"'"'C:\\Users\\siddh\\AppData\\Local\\Temp\\pycharm-packaging\\Jinja\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\siddh\AppData\Local\Temp\pycharm-packaging\Jinja\pip-egg-info'
cwd: C:\Users\siddh\AppData\Local\Temp\pycharm-packaging\Jinja\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\siddh\AppData\Local\Temp\pycharm-packaging\Jinja\setup.py", line 28
except DistutilsError, e:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
How can I solve this?
I am trying to install djangorestframework-extensions using the command:
pip install djangorestframework-extensions
and it shows the error:
ERROR: Command errored out with exit status 1:
command: /home/anamaria/workspace/licenta/AllFest2/festivals/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r9q6vdlo/djangorestframework-extensions/setup.py'"'"'; __file__='"'"'/tmp/pip-install-r9q6vdlo/djangorestframework-extensions/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-r9q6vdlo/djangorestframework-extensions/pip-egg-info
cwd: /tmp/pip-install-r9q6vdlo/djangorestframework-extensions/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-r9q6vdlo/djangorestframework-extensions/setup.py", line 48
print "You probably want to also tag the version now:"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("You probably want to also tag the version now:")?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
What should i do?
this package seems to suffer incompatibilities between Python2 and python3.
you can try to fix "/tmp/pip-install-r9q6vdlo/djangorestframework-extensions/setup.py" by hand replacing all '''print something''' by '''print(something)'''
it might fail so if you have the choice it's probably better to run it with python 2 despite python two is now old.