open-mmlab / OpenPCDet

OpenPCDet Toolbox for LiDAR-based 3D Object Detection.
Apache License 2.0
4.67k stars 1.3k forks source link

python setup.py develop error #172

Closed 15910693796 closed 4 years ago

15910693796 commented 4 years ago

hello! When I type "sudo python setup.py develop" in the terminal ,I get this error:

File "setup.py", line 26 print('version = "%s"' % version, file=f) ^ SyntaxError: invalid syntax

sshaoshuai commented 4 years ago

Please check your python version. This repo only supports python 3.

15910693796 commented 4 years ago

Please check your python version. This repo only supports python 3.

First of all, thank you very much for your reply. I also guess the reason for the error is that the python version is not 3.x. However,I use conda to configure the virtual environment and it shows that the current Python version is 3.6.10. The details are as follows.

(py36_OpenPCDet) wlz@wlz-Legion-Y7000-2019-PG0:/OpenPCDet$ sudo python setup.py develop [sudo] wlz 的密码: File "setup.py", line 26 print('version = "%s"' % version, file=f) ^ SyntaxError: invalid syntax (py36_OpenPCDet) wlz@wlz-Legion-Y7000-2019-PG0:/OpenPCDet$ python --version Python 3.6.10 :: Anaconda, Inc.

leihui6 commented 4 years ago

Please check your python version. This repo only supports python 3.

First of all, thank you very much for your reply. I also guess the reason for the error is that the python version is not 3.x. However,I use conda to configure the virtual environment and it shows that the current Python version is 3.6.10. The details are as follows.

(py36_OpenPCDet) wlz@wlz-Legion-Y7000-2019-PG0:/OpenPCDet$ sudo python setup.py develop [sudo] wlz 的密码: File "setup.py", line 26 print('version = "%s"' % version, file=f) ^ SyntaxError: invalid syntax (py36_OpenPCDet) wlz@wlz-Legion-Y7000-2019-PG0:/OpenPCDet$ python --version Python 3.6.10 :: Anaconda, Inc.

I think this is a weird problem caused by indentation, so I suggest you check the indentation(4 spaces) before and after print('version = "%s"' % version, file=f). Additionally, as you did nothing modification on source code, you can also check out the encoding of python interpreter by running print(sys.getdefaultencoding()) // the result should be utf-8

Hope this answer helps you!

sshaoshuai commented 4 years ago

Feel free to re-open it if you still have problems.