-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
Install and find SyntaxError: invalid syntax #69
Comments
Did you install python2 headers with?: sudo apt-get install libpython2.7-dev |
Yes, I already install libpython2.7-dev. |
Do you have multiple versions of python installed on your system? It looks like the generated python file belongs to python3, though, I'm not entirely sure. |
Could you please paste the whole output of CMake? There should be a line telling us which mode (python2 or python3) has been used to create the binding. |
Yes, I have both python 3 and python 2. The following is the whole output of
|
Should I run cmake before I run python setup.py? When I run cmake .., I get these output:
|
As we can see in your log, CMake generated a python 3 interface file: ...
-- Found -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.4m.so (found version "3.4.3")
-- Using Python 3 mode.PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.4m.so (found version "3.4.3")
-- Using Python 3 mode.
... It looks like |
So what can I do to make it work? Thank you! |
For now I was not able to properly pass the shell environment variables to python/cmake. However, you can you edit your ...
from shutil import rmtree, copy2
from os import path, chdir, putenv # add putenv
from glob import glob
import subprocess
cmake_bin = "cmake"
cmake_build_config = "Release"
cmake_build_target = "_tinysplinepython"
# export your environment variables
putenv("PYTHON_LIBRARY", "/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so")
putenv("PYTHON_INCLUDE_DIR", "/usr/include/python2.7")
... I will try to properly fix this issue as soon as possible (later this day). |
I found that the environment variables exported as a regular user are not available with sudo -s
export PYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
export PYTHON_INCLUDE_DIR=/usr/include/python2.7
python setup.py install |
Have a look at: http://stackoverflow.com/questions/8633461/how-to-keep-environment-variables-when-using-sudo. It shows that with sudo -E python setup.py install I tried it on my machine and it works flawless. |
Thank you! I will take a try! Maybe on Monday, we are off now. Wish you a good weekend^_^ |
Hi, I use
When I use python3 to run I get the same output
Here is the output of compilation:
|
Looks like an error introduced by the recently added double precision support. Will fix it as soon as possible. |
OK, thank you:) |
Should be fixed with newest commit. |
Can I close this one? |
Yes of course:) |
Hi, I follow the install instruction:
and get SyntaxError: invalid syntax
Could you please help? Thank you.
The text was updated successfully, but these errors were encountered: